Skip to content

Commit e0d2e2a

Browse files
committed
Correct case of $PSHOME special variable
1 parent 2782b73 commit e0d2e2a

28 files changed

Lines changed: 58 additions & 58 deletions

src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,17 @@ function Enable-PSWSManCombinedTrace
172172
$traceFileName = [string][Guid]::NewGuid()
173173
if ($DoNotOverwriteExistingTrace) {
174174
$fileName = [string][guid]::newguid()
175-
$logfile = $pshome + "\\Traces\\PSTrace_$fileName.etl"
175+
$logfile = $PSHOME + "\\Traces\\PSTrace_$fileName.etl"
176176
} else {
177-
$logfile = $pshome + "\\Traces\\PSTrace.etl"
177+
$logfile = $PSHOME + "\\Traces\\PSTrace.etl"
178178
}
179179

180180
"Microsoft-Windows-PowerShell 0 5" | out-file $provfile -encoding ascii
181181
"Microsoft-Windows-WinRM 0 5" | out-file $provfile -encoding ascii -append
182182

183-
if (!(Test-Path $pshome\Traces))
183+
if (!(Test-Path $PSHOME\Traces))
184184
{
185-
New-Item -ItemType Directory -Force $pshome\Traces | out-null
185+
New-Item -ItemType Directory -Force $PSHOME\Traces | out-null
186186
}
187187

188188
if (Test-Path $logfile)

test/powershell/Host/Base-Directory.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Describe "Configuration file locations" -tags "CI","Slow" {
44

55
BeforeAll {
6-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
6+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
77
$profileName = "Microsoft.PowerShell_profile.ps1"
88
}
99

test/powershell/Host/ConsoleHost.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using namespace System.Diagnostics
1111
Describe 'minishell for native executables' -Tag 'CI' {
1212

1313
BeforeAll {
14-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
14+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
1515
}
1616

1717
Context 'Streams from minishell' {
@@ -53,7 +53,7 @@ Describe 'minishell for native executables' -Tag 'CI' {
5353
Describe "ConsoleHost unit tests" -tags "Feature" {
5454

5555
BeforeAll {
56-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
56+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
5757
$ExitCodeBadCommandLineParameter = 64
5858

5959
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
@@ -966,7 +966,7 @@ Describe "Pwsh exe resources tests" -Tag CI {
966966

967967
Describe 'Pwsh startup in directories that contain wild cards' -Tag CI {
968968
BeforeAll {
969-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
969+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
970970
$dirnames = "[T]est","[Test","T][est","Test"
971971
$testcases = @()
972972
foreach ( $d in $dirnames ) {

test/powershell/Host/Logging.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Describe 'Basic SysLog tests on Linux' -Tag @('CI','RequireSudoOnUnix') {
155155
Write-Warning -Message 'Unsupported Linux syslog configuration.'
156156
$IsSupportedEnvironment = $false
157157
}
158-
[string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh'
158+
[string] $powershell = Join-Path -Path $PSHOME -ChildPath 'pwsh'
159159
$scriptBlockCreatedRegExTemplate = @"
160160
Creating Scriptblock text \(1 of 1\):#012{0}(⏎|#012)*ScriptBlock ID: [0-9a-z\-]*#012Path:.*
161161
"@
@@ -273,7 +273,7 @@ Describe 'Basic os_log tests on MacOS' -Tag @('CI','RequireSudoOnUnix') {
273273
Set-OsLogPersistence -Enable
274274
}
275275
}
276-
[string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh'
276+
[string] $powershell = Join-Path -Path $PSHOME -ChildPath 'pwsh'
277277
$scriptBlockCreatedRegExTemplate = @'
278278
Creating Scriptblock text \(1 of 1\):
279279
{0}
@@ -436,7 +436,7 @@ $PID
436436
Describe 'Basic EventLog tests on Windows' -Tag @('CI','RequireAdminOnWindows') {
437437
BeforeAll {
438438
[bool] $IsSupportedEnvironment = $IsWindows
439-
[string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh'
439+
[string] $powershell = Join-Path -Path $PSHOME -ChildPath 'pwsh'
440440
$scriptBlockLoggingCases = @(
441441
@{
442442
name = 'normal script block'
@@ -452,7 +452,7 @@ Describe 'Basic EventLog tests on Windows' -Tag @('CI','RequireAdminOnWindows')
452452

453453
if ($IsSupportedEnvironment)
454454
{
455-
& "$PSHome\RegisterManifest.ps1"
455+
& "$PSHOME\RegisterManifest.ps1"
456456
}
457457
}
458458

test/powershell/Host/PSVersionTable.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Describe "PSVersionTable" -Tags "CI" {
44

55
BeforeAll {
6-
$sma = Get-Item (Join-Path $PSHome "System.Management.Automation.dll")
6+
$sma = Get-Item (Join-Path $PSHOME "System.Management.Automation.dll")
77
$formattedVersion = $sma.VersionInfo.ProductVersion
88

99
$mainVersionPattern = "(\d+\.\d+\.\d+)(-.+)?"

test/powershell/Host/Read-Host.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Describe "Read-Host" -Tags "Slow","Feature" {
44
Context "[Console]::ReadKey() implementation on non-Windows" {
55
BeforeAll {
6-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
6+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
77
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
88
if ($IsWindows) {
99
$ItArgs = @{ skip = $true }

test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ Describe "TabCompletion" -Tags CI {
697697
@{ inputStr = '$PSMod'; expected = '$PSModuleAutoLoadingPreference'; setup = $null }
698698
## tab completion for variable in path
699699
## if $PSHOME contains a space tabcompletion adds ' around the path
700-
@{ inputStr = 'cd $pshome\Modu'; expected = if($PSHOME.Contains(' ')) { "'$(Join-Path $PSHOME 'Modules')'" } else { Join-Path $PSHOME 'Modules' }; setup = $null }
701-
@{ inputStr = 'cd "$pshome\Modu"'; expected = "`"$(Join-Path $PSHOME 'Modules')`""; setup = $null }
700+
@{ inputStr = 'cd $PSHOME\Modu'; expected = if($PSHOME.Contains(' ')) { "'$(Join-Path $PSHOME 'Modules')'" } else { Join-Path $PSHOME 'Modules' }; setup = $null }
701+
@{ inputStr = 'cd "$PSHOME\Modu"'; expected = "`"$(Join-Path $PSHOME 'Modules')`""; setup = $null }
702702
@{ inputStr = '$PSHOME\System.Management.Au'; expected = if($PSHOME.Contains(' ')) { "`& '$(Join-Path $PSHOME 'System.Management.Automation.dll')'" } else { Join-Path $PSHOME 'System.Management.Automation.dll'; setup = $null }}
703703
@{ inputStr = '"$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null }
704704
@{ inputStr = '& "$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null }

test/powershell/Language/Operators/TernaryOperator.Tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ Describe "Using of ternary operator" -Tags CI {
8888

8989
It "Tab completion for variables assigned with ternary expression should work as expected" {
9090
## Type inference for the ternary expression should aggregate the inferred values from both branches
91-
$text1 = '$var1 = $IsCoreCLR ? (Get-Item $PSHome) : (Get-Process -Id $PID); $var1.Full'
91+
$text1 = '$var1 = $IsCoreCLR ? (Get-Item $PSHOME) : (Get-Process -Id $PID); $var1.Full'
9292
$result = TabExpansion2 -inputScript $text1 -cursorColumn $text1.Length
9393
$result.CompletionMatches[0].CompletionText | Should -BeExactly FullName
9494

95-
$text2 = '$var1 = $IsCoreCLR ? (Get-Item $PSHome) : (Get-Process -Id $PID); $var1.Proce'
95+
$text2 = '$var1 = $IsCoreCLR ? (Get-Item $PSHOME) : (Get-Process -Id $PID); $var1.Proce'
9696
$result = TabExpansion2 -inputScript $text2 -cursorColumn $text2.Length
9797
$result.CompletionMatches[0].CompletionText | Should -BeExactly ProcessName
9898

99-
$text3 = '$IsCoreCLR ? ($var2 = Get-Item $PSHome) : "blah"; $var2.Full'
99+
$text3 = '$IsCoreCLR ? ($var2 = Get-Item $PSHOME) : "blah"; $var2.Full'
100100
$result = TabExpansion2 -inputScript $text3 -cursorColumn $text3.Length
101101
$result.CompletionMatches[0].CompletionText | Should -BeExactly FullName
102102
}

test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Describe 'Native pipeline should have proper encoding' -tags 'CI' {
1010
Describe 'native commands with pipeline' -tags 'Feature' {
1111

1212
BeforeAll {
13-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
13+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
1414
}
1515

1616
It "native | ps | native doesn't block" {

test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License.
33
Describe "Native streams behavior with PowerShell" -Tags 'CI' {
44
BeforeAll {
5-
$powershell = Join-Path -Path $PsHome -ChildPath "pwsh"
5+
$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh"
66
}
77

88
Context "Error stream" {

0 commit comments

Comments
 (0)