Skip to content

Commit 6a6109d

Browse files
authored
Explain use of relative output paths (MicrosoftDocs#12488)
1 parent 6037abf commit 6a6109d

File tree

4 files changed

+103
-8
lines changed

4 files changed

+103
-8
lines changed

reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.ConsoleHost.dll-help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Host
5-
ms.date: 01/06/2025
5+
ms.date: 11/05/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Start-Transcript
@@ -98,6 +98,19 @@ Start-Transcript
9898
The full path to the transcript file is stored in the `$Transcript` preference variable. For more
9999
information about the `$Transcript` preference variable, see
100100
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript).
101+
### Example 4: Start a transcript using a relative path on Windows systems
102+
103+
When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative
104+
to your `Documents` directory.
105+
106+
```powershell
107+
Start-Transcript -Path .\transcripts
108+
```
109+
110+
```Output
111+
Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt
112+
```
113+
101114

102115
## PARAMETERS
103116

@@ -191,7 +204,8 @@ Accept wildcard characters: False
191204
### -OutputDirectory
192205

193206
Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns
194-
the transcript name.
207+
the transcript name. If you use a relative path, the path is relative to your `Documents` directory
208+
on Windows.
195209

196210
```yaml
197211
Type: System.String

reference/7.4/Microsoft.PowerShell.Host/Start-Transcript.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Host
5-
ms.date: 01/06/2025
5+
ms.date: 11/05/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Start-Transcript
@@ -100,6 +100,32 @@ The full path to the transcript file is stored in the `$Transcript` preference v
100100
information about the `$Transcript` preference variable, see
101101
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript).
102102

103+
### Example 4: Start a transcript using a relative path on Windows systems
104+
105+
When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative
106+
to your `Documents` directory.
107+
108+
```powershell
109+
Start-Transcript -Path .\transcripts
110+
```
111+
112+
```Output
113+
Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt
114+
```
115+
116+
### Example 5: Start a transcript using a relative path on non-Windows systems
117+
118+
When you use a relative path with the **OutputDirectory** parameter on non-Windows systems, the path is relative
119+
to your home directory.
120+
121+
```powershell
122+
Start-Transcript -Path ./transcripts
123+
```
124+
125+
```Output
126+
Transcript started, output file is /home/username/./transcripts/PowerShell_transcript.hostname.ift21QeV.20251105151236.txt
127+
```
128+
103129
## PARAMETERS
104130

105131
### -Append
@@ -192,7 +218,8 @@ Accept wildcard characters: False
192218
### -OutputDirectory
193219

194220
Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns
195-
the transcript name.
221+
the transcript name. If you use a relative path, the path is relative to your `Documents` directory
222+
on Windows. On Linux and macOS, the path is relative to your home directory.
196223

197224
```yaml
198225
Type: System.String

reference/7.5/Microsoft.PowerShell.Host/Start-Transcript.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Host
5-
ms.date: 01/06/2025
5+
ms.date: 11/05/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.5&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Start-Transcript
@@ -100,6 +100,32 @@ The full path to the transcript file is stored in the `$Transcript` preference v
100100
information about the `$Transcript` preference variable, see
101101
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript).
102102

103+
### Example 4: Start a transcript using a relative path on Windows systems
104+
105+
When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative
106+
to your `Documents` directory.
107+
108+
```powershell
109+
Start-Transcript -Path .\transcripts
110+
```
111+
112+
```Output
113+
Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt
114+
```
115+
116+
### Example 5: Start a transcript using a relative path on non-Windows systems
117+
118+
When you use a relative path with the **OutputDirectory** parameter on non-Windows systems, the path is relative
119+
to your home directory.
120+
121+
```powershell
122+
Start-Transcript -Path ./transcripts
123+
```
124+
125+
```Output
126+
Transcript started, output file is /home/username/./transcripts/PowerShell_transcript.hostname.ift21QeV.20251105151236.txt
127+
```
128+
103129
## PARAMETERS
104130

105131
### -Append
@@ -192,7 +218,8 @@ Accept wildcard characters: False
192218
### -OutputDirectory
193219

194220
Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns
195-
the transcript name.
221+
the transcript name. If you use a relative path, the path is relative to your `Documents` directory
222+
on Windows. On Linux and macOS, the path is relative to your home directory.
196223

197224
```yaml
198225
Type: System.String

reference/7.6/Microsoft.PowerShell.Host/Start-Transcript.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.ConsoleHost.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Host
5-
ms.date: 02/18/2025
5+
ms.date: 11/05/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.host/start-transcript?view=powershell-7.6&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Start-Transcript
@@ -100,6 +100,32 @@ The full path to the transcript file is stored in the `$Transcript` preference v
100100
information about the `$Transcript` preference variable, see
101101
[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#transcript).
102102

103+
### Example 4: Start a transcript using a relative path on Windows systems
104+
105+
When you use a relative path with the **OutputDirectory** parameter on Windows, the path is relative
106+
to your `Documents` directory.
107+
108+
```powershell
109+
Start-Transcript -Path .\transcripts
110+
```
111+
112+
```Output
113+
Transcript started, output file is C:\Users\username\Documents\.\transcripts\PowerShell_transcript.HOSTNAME.8S6RpEfN.20251105152247.txt
114+
```
115+
116+
### Example 5: Start a transcript using a relative path on non-Windows systems
117+
118+
When you use a relative path with the **OutputDirectory** parameter on non-Windows systems, the path is relative
119+
to your home directory.
120+
121+
```powershell
122+
Start-Transcript -Path ./transcripts
123+
```
124+
125+
```Output
126+
Transcript started, output file is /home/username/./transcripts/PowerShell_transcript.hostname.ift21QeV.20251105151236.txt
127+
```
128+
103129
## PARAMETERS
104130

105131
### -Append
@@ -192,7 +218,8 @@ Accept wildcard characters: False
192218
### -OutputDirectory
193219

194220
Specifies a specific path and folder in which to save a transcript. PowerShell automatically assigns
195-
the transcript name.
221+
the transcript name. If you use a relative path, the path is relative to your `Documents` directory
222+
on Windows. On Linux and macOS, the path is relative to your home directory.
196223

197224
```yaml
198225
Type: System.String

0 commit comments

Comments
 (0)