From d31294e9627a623f35d2f288339cf9c22f7bfa3e Mon Sep 17 00:00:00 2001 From: "Shaun Lawrie (via GitHub Actions)" Date: Sat, 16 Mar 2024 02:10:11 +1300 Subject: [PATCH] Undo that --- PwshSpectreConsole.Docs/src/powershell/UpdateDocs.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PwshSpectreConsole.Docs/src/powershell/UpdateDocs.ps1 b/PwshSpectreConsole.Docs/src/powershell/UpdateDocs.ps1 index 5f87a026..ae9f5067 100644 --- a/PwshSpectreConsole.Docs/src/powershell/UpdateDocs.ps1 +++ b/PwshSpectreConsole.Docs/src/powershell/UpdateDocs.ps1 @@ -155,12 +155,9 @@ foreach ($doc in $docs) { Write-Host "Modified sample:" Write-Host -ForegroundColor DarkGray $code if($code -like "*Write-Error*") { - $ErrorActionPreference = "SilentlyContinue" - Invoke-Expression $code - $ErrorActionPreference = "Stop" - } else { - Invoke-Expression $code + $code = $code -replace "Write-Error", "Write-Host" } + Invoke-Expression $code $recording = Stop-SpectreRecording -Title "Example $([int]$example++)" $castName = ($doc.Name -replace '.md$', '' -replace '-', '').ToLower() + "Example$example"