Files
blog/scripts/remove_status_hidden.ps1
T
2026-01-22 21:26:48 +08:00

11 lines
505 B
PowerShell

$files = Get-ChildItem -Path "content" -Recurse -Filter "*.md"
foreach ($file in $files) {
$content = Get-Content $file.FullName -Raw -Encoding UTF8
if ($content -match "status:\s*hidden") {
$newContent = $content -replace "status:\s*hidden`r`n", "" -replace "status:\s*hidden`n", "" -replace "status:\s*`"hidden`"`r`n", "" -replace "status:\s*`"hidden`"`n", ""
Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8
Write-Host "Updated $($file.Name)"
}
}