From 87dade12c44006a24d778e6405ba9819101c1601 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 5 Nov 2025 15:30:52 -0600 Subject: [PATCH] Explain use of relative output paths --- .../Start-Transcript.md | 18 +++++++++-- .../Start-Transcript.md | 31 +++++++++++++++++-- .../Start-Transcript.md | 31 +++++++++++++++++-- .../Start-Transcript.md | 31 +++++++++++++++++-- 4 files changed, 103 insertions(+), 8 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index ef825823fae3..8c11d04f8039 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 01/06/2025 +ms.date: 11/05/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -98,6 +98,19 @@ Start-Transcript The full path to the transcript file is stored in the `$Transcript` preference variable. For more information about the `$Transcript` preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript). +### Example 4: Start a transcript using a relative path on Windows systems + +When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative +to your `Documents` directory. + +```powershell +Start-Transcript -Path .\transcripts +``` + +```Output +Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt +``` + ## PARAMETERS @@ -191,7 +204,8 @@ Accept wildcard characters: False ### -OutputDirectory Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns -the transcript name. +the transcript name. If you use a relative path, the path is relative to your `Documents` directory +on Windows. ```yaml Type: System.String diff --git a/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md index 890ffd504afc..96312f2b01c0 100644 --- a/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 01/06/2025 +ms.date: 11/05/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -100,6 +100,32 @@ The full path to the transcript file is stored in the `$Transcript` preference v information about the `$Transcript` preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript). +### Example 4: Start a transcript using a relative path on Windows systems + +When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative +to your `Documents` directory. + +```powershell +Start-Transcript -Path .\transcripts +``` + +```Output +Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt +``` + +### Example 5: Start a transcript using a relative path on non-Windows systems + +When you use a relative path with the **OutputDirectory** parameter on non-Windows systems, the path is relative +to your home directory. + +```powershell +Start-Transcript -Path ./transcripts +``` + +```Output +Transcript started, output file is /home/username/./transcripts/PowerShell_transcript.hostname.ift21QeV.20251105151236.txt +``` + ## PARAMETERS ### -Append @@ -192,7 +218,8 @@ Accept wildcard characters: False ### -OutputDirectory Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns -the transcript name. +the transcript name. If you use a relative path, the path is relative to your `Documents` directory +on Windows. On Linux and macOS, the path is relative to your home directory. ```yaml Type: System.String diff --git a/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md index 4b895baac7b3..1359a1cbfc68 100644 --- a/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 01/06/2025 +ms.date: 11/05/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -100,6 +100,32 @@ The full path to the transcript file is stored in the `$Transcript` preference v information about the `$Transcript` preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript). +### Example 4: Start a transcript using a relative path on Windows systems + +When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative +to your `Documents` directory. + +```powershell +Start-Transcript -Path .\transcripts +``` + +```Output +Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt +``` + +### Example 5: Start a transcript using a relative path on non-Windows systems + +When you use a relative path with the **OutputDirectory** parameter on non-Windows systems, the path is relative +to your home directory. + +```powershell +Start-Transcript -Path ./transcripts +``` + +```Output +Transcript started, output file is /home/username/./transcripts/PowerShell_transcript.hostname.ift21QeV.20251105151236.txt +``` + ## PARAMETERS ### -Append @@ -192,7 +218,8 @@ Accept wildcard characters: False ### -OutputDirectory Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns -the transcript name. +the transcript name. If you use a relative path, the path is relative to your `Documents` directory +on Windows. On Linux and macOS, the path is relative to your home directory. ```yaml Type: System.String diff --git a/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md index 1993d7825d06..47367ca067ce 100644 --- a/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Host -ms.date: 02/18/2025 +ms.date: 11/05/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: Start-Transcript @@ -100,6 +100,32 @@ The full path to the transcript file is stored in the `$Transcript` preference v information about the `$Transcript` preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript). +### Example 4: Start a transcript using a relative path on Windows systems + +When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative +to your `Documents` directory. + +```powershell +Start-Transcript -Path .\transcripts +``` + +```Output +Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt +``` + +### Example 5: Start a transcript using a relative path on non-Windows systems + +When you use a relative path with the **OutputDirectory** parameter on non-Windows systems, the path is relative +to your home directory. + +```powershell +Start-Transcript -Path ./transcripts +``` + +```Output +Transcript started, output file is /home/username/./transcripts/PowerShell_transcript.hostname.ift21QeV.20251105151236.txt +``` + ## PARAMETERS ### -Append @@ -192,7 +218,8 @@ Accept wildcard characters: False ### -OutputDirectory Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns -the transcript name. +the transcript name. If you use a relative path, the path is relative to your `Documents` directory +on Windows. On Linux and macOS, the path is relative to your home directory. ```yaml Type: System.String