25 lines
679 B
PowerShell
25 lines
679 B
PowerShell
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
|
|
|
$docxPath = "e:\GitHub\igny8-ai-seo\docs\Igny8 WP Plugin to Igny8 App Migration Plan.docx"
|
|
$zip = [System.IO.Compression.ZipFile]::OpenRead($docxPath)
|
|
|
|
$entry = $zip.Entries | Where-Object { $_.FullName -eq "word/document.xml" }
|
|
if ($entry) {
|
|
$stream = $entry.Open()
|
|
$reader = New-Object System.IO.StreamReader($stream)
|
|
$xml = $reader.ReadToEnd()
|
|
$reader.Close()
|
|
$stream.Close()
|
|
|
|
# Extract text from XML (simple approach)
|
|
$xml = $xml -replace '<[^>]+>', "`n"
|
|
$xml = $xml -replace '\s+', " "
|
|
$xml = $xml -replace '\n\s*\n', "`n"
|
|
|
|
Write-Output $xml.Trim()
|
|
}
|
|
|
|
$zip.Dispose()
|
|
|
|
|