From 5230e1560d383d58dd9b85f867962aea96f3ff93 Mon Sep 17 00:00:00 2001 From: deadlydog Date: Fri, 14 Feb 2025 12:12:09 -0600 Subject: [PATCH 1/3] docs: Mention Windows PowerShell 5 bug where Write-Information logic is reversed in Start-Transcript --- .../5.1/Microsoft.PowerShell.Host/Start-Transcript.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index 8d3e6d963782..79aca7256176 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -266,6 +266,13 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +> [!NOTE] +> The `Write-Information` logic is reversed in `Start-Transcript`. This means if the +> **InformationPreference** is set to `Continue`, Information messages will be written to the +> console, but not to the transcript file. If the **InformationPreference** is set to +> `SilentlyContinue`, Information messages will not be written to the console, but will be written +> to the transcript file. This is fixed in PowerShell 6. + ## INPUTS ### None From 99d343e68bc0fc02722f10fd885a9d72a226ce58 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 18 Feb 2025 09:04:08 -0600 Subject: [PATCH 2/3] Update note on `Start-Transcript` behavior editorial --- .../Microsoft.PowerShell.Host/Start-Transcript.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index 79aca7256176..f2ed46413391 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -266,12 +266,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). -> [!NOTE] -> The `Write-Information` logic is reversed in `Start-Transcript`. This means if the -> **InformationPreference** is set to `Continue`, Information messages will be written to the -> console, but not to the transcript file. If the **InformationPreference** is set to -> `SilentlyContinue`, Information messages will not be written to the console, but will be written -> to the transcript file. This is fixed in PowerShell 6. ## INPUTS @@ -292,6 +286,13 @@ To stop a transcript, use the `Stop-Transcript` cmdlet. To record an entire session, add the `Start-Transcript` command to your profile. For more information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). +> [!NOTE] +> When you use `Start-Transcript`, the default value of `$InformationPreference`** is changed to +> `Continue`. Output from `Write-Information` is written to the console, but not to the transcript +> file. If the **InformationPreference** is set to `SilentlyContinue`, Information messages aren't +> written to the console, but are written to the transcript file. This is fixed in PowerShell 6 and +> higher. + ## RELATED LINKS [Stop-Transcript](Stop-Transcript.md) From f62d6a1a6628c2fdf28c1fb62b1049b5c9f8312a Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 18 Feb 2025 09:06:25 -0600 Subject: [PATCH 3/3] Fix formatting issues in Start-Transcript documentation --- reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index f2ed46413391..1fc16acad8f0 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -287,9 +287,9 @@ To record an entire session, add the `Start-Transcript` command to your profile. information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). > [!NOTE] -> When you use `Start-Transcript`, the default value of `$InformationPreference`** is changed to +> When you use `Start-Transcript`, the default value of `$InformationPreference` is changed to > `Continue`. Output from `Write-Information` is written to the console, but not to the transcript -> file. If the **InformationPreference** is set to `SilentlyContinue`, Information messages aren't +> file. If the `$InformationPreference` is set to `SilentlyContinue`, Information messages aren't > written to the console, but are written to the transcript file. This is fixed in PowerShell 6 and > higher.