docs.sheetjs.com/tests/email/pst.ps1

22 lines
643 B
PowerShell
Raw Normal View History

2026-01-29 04:58:19 +00:00
#!/usr/bin/env pwsh
# https://docs.sheetjs.com/docs/demos/net/email/pst
$oldDir = Get-Location
$tempDir = Join-Path -Path $env:TEMP -ChildPath "sheetjs-pst"
if (Test-Path -Path $tempDir) { Remove-Item -Path $tempDir -Recurse -Force }
New-Item -ItemType Directory -Path $tempDir | Out-Null
Set-Location -Path $tempDir
npm init -y
Invoke-WebRequest -Uri "https://docs.sheetjs.com/pst/SheetJSPST.js" -OutFile "SheetJSPST.js"
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz pst-extractor@1.11.0
node --version
node SheetJSPST.js
bun --version
bun SheetJSPST.js
Set-Location $oldDir
Remove-Item -Path $tempDir -Recurse -Force