diff --git a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 index 478e8e6977..ecfdb1364d 100644 --- a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 +++ b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 @@ -172,17 +172,17 @@ function Enable-PSWSManCombinedTrace $traceFileName = [string][Guid]::NewGuid() if ($DoNotOverwriteExistingTrace) { $fileName = [string][guid]::newguid() - $logfile = $pshome + "\\Traces\\PSTrace_$fileName.etl" + $logfile = $PSHOME + "\\Traces\\PSTrace_$fileName.etl" } else { - $logfile = $pshome + "\\Traces\\PSTrace.etl" + $logfile = $PSHOME + "\\Traces\\PSTrace.etl" } "Microsoft-Windows-PowerShell 0 5" | out-file $provfile -encoding ascii "Microsoft-Windows-WinRM 0 5" | out-file $provfile -encoding ascii -append - if (!(Test-Path $pshome\Traces)) + if (!(Test-Path $PSHOME\Traces)) { - New-Item -ItemType Directory -Force $pshome\Traces | out-null + New-Item -ItemType Directory -Force $PSHOME\Traces | out-null } if (Test-Path $logfile) diff --git a/test/powershell/Host/Base-Directory.Tests.ps1 b/test/powershell/Host/Base-Directory.Tests.ps1 index cb45291c78..71f6e682ed 100644 --- a/test/powershell/Host/Base-Directory.Tests.ps1 +++ b/test/powershell/Host/Base-Directory.Tests.ps1 @@ -3,7 +3,7 @@ Describe "Configuration file locations" -tags "CI","Slow" { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" $profileName = "Microsoft.PowerShell_profile.ps1" } diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index ccfcff70e8..432a3913a1 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -11,7 +11,7 @@ using namespace System.Diagnostics Describe 'minishell for native executables' -Tag 'CI' { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" } Context 'Streams from minishell' { @@ -53,7 +53,7 @@ Describe 'minishell for native executables' -Tag 'CI' { Describe "ConsoleHost unit tests" -tags "Feature" { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" $ExitCodeBadCommandLineParameter = 64 function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) @@ -966,7 +966,7 @@ Describe "Pwsh exe resources tests" -Tag CI { Describe 'Pwsh startup in directories that contain wild cards' -Tag CI { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" $dirnames = "[T]est","[Test","T][est","Test" $testcases = @() foreach ( $d in $dirnames ) { diff --git a/test/powershell/Host/Logging.Tests.ps1 b/test/powershell/Host/Logging.Tests.ps1 index f66c84246a..36ff5feb52 100644 --- a/test/powershell/Host/Logging.Tests.ps1 +++ b/test/powershell/Host/Logging.Tests.ps1 @@ -155,7 +155,7 @@ Describe 'Basic SysLog tests on Linux' -Tag @('CI','RequireSudoOnUnix') { Write-Warning -Message 'Unsupported Linux syslog configuration.' $IsSupportedEnvironment = $false } - [string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh' + [string] $powershell = Join-Path -Path $PSHOME -ChildPath 'pwsh' $scriptBlockCreatedRegExTemplate = @" Creating Scriptblock text \(1 of 1\):#012{0}(⏎|#012)*ScriptBlock ID: [0-9a-z\-]*#012Path:.* "@ @@ -273,7 +273,7 @@ Describe 'Basic os_log tests on MacOS' -Tag @('CI','RequireSudoOnUnix') { Set-OsLogPersistence -Enable } } - [string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh' + [string] $powershell = Join-Path -Path $PSHOME -ChildPath 'pwsh' $scriptBlockCreatedRegExTemplate = @' Creating Scriptblock text \(1 of 1\): {0} @@ -436,7 +436,7 @@ $PID Describe 'Basic EventLog tests on Windows' -Tag @('CI','RequireAdminOnWindows') { BeforeAll { [bool] $IsSupportedEnvironment = $IsWindows - [string] $powershell = Join-Path -Path $PSHome -ChildPath 'pwsh' + [string] $powershell = Join-Path -Path $PSHOME -ChildPath 'pwsh' $scriptBlockLoggingCases = @( @{ name = 'normal script block' @@ -452,7 +452,7 @@ Describe 'Basic EventLog tests on Windows' -Tag @('CI','RequireAdminOnWindows') if ($IsSupportedEnvironment) { - & "$PSHome\RegisterManifest.ps1" + & "$PSHOME\RegisterManifest.ps1" } } diff --git a/test/powershell/Host/PSVersionTable.Tests.ps1 b/test/powershell/Host/PSVersionTable.Tests.ps1 index 722adffbec..5615cbe813 100644 --- a/test/powershell/Host/PSVersionTable.Tests.ps1 +++ b/test/powershell/Host/PSVersionTable.Tests.ps1 @@ -3,7 +3,7 @@ Describe "PSVersionTable" -Tags "CI" { BeforeAll { - $sma = Get-Item (Join-Path $PSHome "System.Management.Automation.dll") + $sma = Get-Item (Join-Path $PSHOME "System.Management.Automation.dll") $formattedVersion = $sma.VersionInfo.ProductVersion $mainVersionPattern = "(\d+\.\d+\.\d+)(-.+)?" diff --git a/test/powershell/Host/Read-Host.Tests.ps1 b/test/powershell/Host/Read-Host.Tests.ps1 index b85338ea48..0980965970 100644 --- a/test/powershell/Host/Read-Host.Tests.ps1 +++ b/test/powershell/Host/Read-Host.Tests.ps1 @@ -3,7 +3,7 @@ Describe "Read-Host" -Tags "Slow","Feature" { Context "[Console]::ReadKey() implementation on non-Windows" { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" $assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets if ($IsWindows) { $ItArgs = @{ skip = $true } diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 6160d25cc1..b97516406f 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -697,8 +697,8 @@ Describe "TabCompletion" -Tags CI { @{ inputStr = '$PSMod'; expected = '$PSModuleAutoLoadingPreference'; setup = $null } ## tab completion for variable in path ## if $PSHOME contains a space tabcompletion adds ' around the path - @{ inputStr = 'cd $pshome\Modu'; expected = if($PSHOME.Contains(' ')) { "'$(Join-Path $PSHOME 'Modules')'" } else { Join-Path $PSHOME 'Modules' }; setup = $null } - @{ inputStr = 'cd "$pshome\Modu"'; expected = "`"$(Join-Path $PSHOME 'Modules')`""; setup = $null } + @{ inputStr = 'cd $PSHOME\Modu'; expected = if($PSHOME.Contains(' ')) { "'$(Join-Path $PSHOME 'Modules')'" } else { Join-Path $PSHOME 'Modules' }; setup = $null } + @{ inputStr = 'cd "$PSHOME\Modu"'; expected = "`"$(Join-Path $PSHOME 'Modules')`""; setup = $null } @{ 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 }} @{ inputStr = '"$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null } @{ inputStr = '& "$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null } diff --git a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 index 99b219a6e6..1b0c810448 100644 --- a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 @@ -88,15 +88,15 @@ Describe "Using of ternary operator" -Tags CI { It "Tab completion for variables assigned with ternary expression should work as expected" { ## Type inference for the ternary expression should aggregate the inferred values from both branches - $text1 = '$var1 = $IsCoreCLR ? (Get-Item $PSHome) : (Get-Process -Id $PID); $var1.Full' + $text1 = '$var1 = $IsCoreCLR ? (Get-Item $PSHOME) : (Get-Process -Id $PID); $var1.Full' $result = TabExpansion2 -inputScript $text1 -cursorColumn $text1.Length $result.CompletionMatches[0].CompletionText | Should -BeExactly FullName - $text2 = '$var1 = $IsCoreCLR ? (Get-Item $PSHome) : (Get-Process -Id $PID); $var1.Proce' + $text2 = '$var1 = $IsCoreCLR ? (Get-Item $PSHOME) : (Get-Process -Id $PID); $var1.Proce' $result = TabExpansion2 -inputScript $text2 -cursorColumn $text2.Length $result.CompletionMatches[0].CompletionText | Should -BeExactly ProcessName - $text3 = '$IsCoreCLR ? ($var2 = Get-Item $PSHome) : "blah"; $var2.Full' + $text3 = '$IsCoreCLR ? ($var2 = Get-Item $PSHOME) : "blah"; $var2.Full' $result = TabExpansion2 -inputScript $text3 -cursorColumn $text3.Length $result.CompletionMatches[0].CompletionText | Should -BeExactly FullName } diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 index dbc0a07469..d47c64f2e3 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 @@ -10,7 +10,7 @@ Describe 'Native pipeline should have proper encoding' -tags 'CI' { Describe 'native commands with pipeline' -tags 'Feature' { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" } It "native | ps | native doesn't block" { diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 index f5ed871108..104afd3e2f 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. Describe "Native streams behavior with PowerShell" -Tags 'CI' { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" } Context "Error stream" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index 2047337c84..adc18e5fc7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -502,7 +502,7 @@ Describe "PSModulePath changes interacting with other PowerShell processes" -Tag Restore-ModulePath } - It "Allows Windows PowerShell subprocesses to call `$PSHome modules still" { + It "Allows Windows PowerShell subprocesses to call `$PSHOME modules still" { $errors = powershell.exe -Command "Get-ChildItem" 2>&1 | Where-Object { $_ -is [System.Management.Automation.ErrorRecord] } $errors | Should -Be $null } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 index 780744a439..1eb0f518c1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -$powershell = Join-Path -Path $PsHome -ChildPath "pwsh" +$powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" function Wait-JobPid { param ( diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 index fe7e0b9666..e78975362f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 @@ -700,7 +700,7 @@ namespace PowershellTestConfigNamespace FunctionDefinitions=@( @{ Name = "sysmodules"; - ScriptBlock = 'pushd $pshome\Modules'; + ScriptBlock = 'pushd $PSHOME\Modules'; Options = "AllScope"; }, @{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 index a12c1e4511..314a72cdd1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 @@ -329,7 +329,7 @@ Describe "Remove-Module : module is readOnly | Constant" -Tags "CI" { Describe "Remove-Module : module provides the PSDrive for current PS Session" -Tags "CI" { It "Remove-Module : module provides the PSDrive for current PS Session" { - $module = Get-Module (Join-Path $PSHome "System.Management.Automation.dll") -ListAvailable + $module = Get-Module (Join-Path $PSHOME "System.Management.Automation.dll") -ListAvailable { Remove-Module $module -ErrorAction Stop } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.RemoveModuleCommand" } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 index 412684312e..44211f09b6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 @@ -100,8 +100,8 @@ try { $LocalSignatureCorruptedScript = Join-Path -Path $remoteTestDirectory -ChildPath LocalSignatureCorruptedScript.ps1 $LocalSignedScript = Join-Path -Path $remoteTestDirectory -ChildPath LocalSignedScript.ps1 $LocalUnsignedScript = Join-Path -Path $remoteTestDirectory -ChildPath LocalUnsignedScript.ps1 - $PSHomeUnsignedModule = Join-Path -Path $PSHome -ChildPath 'Modules' -AdditionalChildPath 'LocalUnsignedModule', 'LocalUnsignedModule.psm1' - $PSHomeUntrustedModule = Join-Path -Path $PSHome -ChildPath 'Modules' -AdditionalChildPath 'LocalUntrustedModule', 'LocalUntrustedModule.psm1' + $PSHomeUnsignedModule = Join-Path -Path $PSHOME -ChildPath 'Modules' -AdditionalChildPath 'LocalUnsignedModule', 'LocalUnsignedModule.psm1' + $PSHomeUntrustedModule = Join-Path -Path $PSHOME -ChildPath 'Modules' -AdditionalChildPath 'LocalUntrustedModule', 'LocalUntrustedModule.psm1' $TrustedSignatureCorruptedScript = Join-Path -Path $remoteTestDirectory -ChildPath TrustedSignatureCorruptedScript.ps1 $TrustedSignedScript = Join-Path -Path $remoteTestDirectory -ChildPath TrustedSignedScript.ps1 $TrustedUnsignedScript = Join-Path -Path $remoteTestDirectory -ChildPath TrustedUnsignedScript.ps1 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 index 583ac5132b..283234005b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 @@ -24,7 +24,7 @@ Describe "Get-FileHash" -Tags "CI" { } It "Should write non-terminating error if argument is a folder" { - $result = $pshome, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable + $result = $PSHOME, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable $result.Count | Should -Be 1 $errorVariable.FullyQualifiedErrorId | Should -BeExactly "UnauthorizedAccessError,Microsoft.PowerShell.Commands.GetFileHashCommand" } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 index 0837536867..96023d4047 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -$ps = Join-Path -Path $PsHome -ChildPath "pwsh" +$ps = Join-Path -Path $PSHOME -ChildPath "pwsh" Describe "Set-PSBreakpoint DRT Unit Tests" -Tags "CI" { #Set up diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 index 7f6ab4666f..97d9b3ae36 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 @@ -3,7 +3,7 @@ Describe "Write-Host with default Console Host" -Tags "Slow","Feature" { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" $testData = @( @{ Name = '-Separator'; Command = "Write-Host a,b,c -Separator '+'"; returnCount = 1; returnValue = @("a+b+c") } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 index 20107efc4e..2e2d3a75b7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 @@ -106,7 +106,7 @@ Describe "XmlCommand DRT basic functionality Tests" -Tags "CI" { It "Import-Clixml should work with XML serialization from pwsh.exe" { # need to create separate process so that current powershell doesn't interpret clixml output - Start-Process -FilePath $pshome\pwsh -RedirectStandardOutput $testfile -Args "-noprofile -nologo -outputformat xml -command get-command import-clixml" -Wait + Start-Process -FilePath $PSHOME\pwsh -RedirectStandardOutput $testfile -Args "-noprofile -nologo -outputformat xml -command get-command import-clixml" -Wait $out = Import-Clixml -Path $testfile $out.Name | Should -Be "Import-CliXml" $out.CommandType.ToString() | Should -Be "Cmdlet" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 index d0a253fcc5..6f520e71cb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 @@ -69,11 +69,11 @@ Describe "String cmdlets" -Tags "CI" { It "match object supports RelativePath method" { $file = "Modules${sep}Microsoft.PowerShell.Utility${sep}Microsoft.PowerShell.Utility.psd1" - $match = Select-String CmdletsToExport $pshome/$file + $match = Select-String CmdletsToExport $PSHOME/$file - $match.RelativePath($pshome) | Should -Be $file - $match.RelativePath($pshome.ToLower()) | Should -Be $file - $match.RelativePath($pshome.ToUpper()) | Should -Be $file + $match.RelativePath($PSHOME) | Should -Be $file + $match.RelativePath($PSHOME.ToLower()) | Should -Be $file + $match.RelativePath($PSHOME.ToUpper()) | Should -Be $file } } } diff --git a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 index 4e61a5fade..1b60d6d430 100644 --- a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 +++ b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 @@ -9,7 +9,7 @@ $script:TestSourceRoot = $PSScriptRoot Describe "Test suite for validating automounted PowerShell drives" -Tags @('Feature', 'Slow', 'RequireAdminOnWindows') { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" $AutomountVHDDriveScriptPath = Join-Path $script:TestSourceRoot 'AutomountVHDDrive.ps1' $vhdPath = Join-Path $TestDrive 'TestAutomountVHD.vhd' diff --git a/test/powershell/SDK/PSDebugging.Tests.ps1 b/test/powershell/SDK/PSDebugging.Tests.ps1 index 5189cb5c5e..02090da3da 100644 --- a/test/powershell/SDK/PSDebugging.Tests.ps1 +++ b/test/powershell/SDK/PSDebugging.Tests.ps1 @@ -6,7 +6,7 @@ using namespace System.Management.Automation.Internal Describe "PowerShell Command Debugging" -tags "CI" { BeforeAll { - $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" + $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" } function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn) diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index eff7d7f702..79475b8ff6 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -217,7 +217,7 @@ Describe "Validate that get-help works for provider specific help" -Tags @('CI') Describe "Validate about_help.txt under culture specific folder works" -Tags @('CI', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { BeforeAll { - $modulePath = "$pshome\Modules\Test" + $modulePath = "$PSHOME\Modules\Test" if (Test-CanWriteToPsHome) { $null = New-Item -Path $modulePath\en-US -ItemType Directory -Force New-ModuleManifest -Path $modulePath\test.psd1 -RootModule test.psm1 @@ -241,7 +241,7 @@ Describe "Validate about_help.txt under culture specific folder works" -Tags @(' Get-ChildItem -Path $aboutHelpPath -Include @('about_*.txt', "*help.xml") -Recurse | Remove-Item -Force -ErrorAction SilentlyContinue } - It "Get-Help should return help text and not multiple HelpInfo objects when help is under `$pshome path" -Skip:(!(Test-CanWriteToPsHome)) { + It "Get-Help should return help text and not multiple HelpInfo objects when help is under `$PSHOME path" -Skip:(!(Test-CanWriteToPsHome)) { $help = Get-Help about_testhelp $help.count | Should -Be 1 diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index f3f733a0b3..a2c2b2265a 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -50,7 +50,7 @@ $testCases = @{ HelpFiles = "Microsoft.Management.Infrastructure.CimCmdlets.dll-help.xml" HelpInfoFiles = "CimCmdlets_fb6cc51d-c096-4b38-b78d-0fed6277096a_HelpInfo.xml" CompressedFiles = "CimCmdlets_fb6cc51d-c096-4b38-b78d-0fed6277096a_en-US_HelpContent$extension" - HelpInstallationPath = "$pshome\Modules\CimCmdlets\en-US" + HelpInstallationPath = "$PSHOME\Modules\CimCmdlets\en-US" HelpInstallationPathHome = "$userHelpRoot\CimCmdlets\en-US" } @@ -58,14 +58,14 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.Archive-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Archive_eb74e8da-9ae2-482a-a648-e96550fb8733_en-US_HelpContent$extension" - HelpInstallationPath = "$pshome\Modules\Microsoft.PowerShell.Archive\en-US" + HelpInstallationPath = "$PSHOME\Modules\Microsoft.PowerShell.Archive\en-US" } "Microsoft.PowerShell.Core" = @{ HelpFiles = "System.Management.Automation.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Core_00000000-0000-0000-0000-000000000000_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Core_00000000-0000-0000-0000-000000000000_en-US_HelpContent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -73,7 +73,7 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.Commands.Diagnostics.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Diagnostics_ca046f10-ca64-4740-8ff9-2565dba61a4f_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Diagnostics_ca046f10-ca64-4740-8ff9-2565dba61a4f_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -81,7 +81,7 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.ConsoleHost.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Host_56d66100-99a0-4ffc-a12d-eee9a6718aef_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Host_56d66100-99a0-4ffc-a12d-eee9a6718aef_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -89,7 +89,7 @@ $testCases = @{ HelpFiles = "Microsoft.Powershell.LocalAccounts.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.LocalAccounts_8e362604-2c0b-448f-a414-a6a690a644e2_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.LocalAccounts_8e362604-2c0b-448f-a414-a6a690a644e2_en-US_HelpContent$extension" - HelpInstallationPath = "$pshome\Modules\Microsoft.PowerShell.LocalAccounts\en-US" + HelpInstallationPath = "$PSHOME\Modules\Microsoft.PowerShell.LocalAccounts\en-US" HelpInstallationPathHome = "$userHelpRoot\Microsoft.PowerShell.LocalAccounts\en-US" } @@ -97,7 +97,7 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.Commands.Management.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Management_eefcb906-b326-4e99-9f54-8b4bb6ef3c6d_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Management_eefcb906-b326-4e99-9f54-8b4bb6ef3c6d_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -105,7 +105,7 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.Security.dll-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Security_a94c8c7e-9810-47c0-b8af-65089c13a35a_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Security_a94c8c7e-9810-47c0-b8af-65089c13a35a_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -113,7 +113,7 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.Commands.Utility.dll-Help.xml", "Microsoft.PowerShell.Utility-help.xml" HelpInfoFiles = "Microsoft.PowerShell.Utility_1da87e53-152b-403e-98dc-74d7b4d63d59_HelpInfo.xml" CompressedFiles = "Microsoft.PowerShell.Utility_1da87e53-152b-403e-98dc-74d7b4d63d59_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -121,7 +121,7 @@ $testCases = @{ HelpFiles = "Microsoft.WSMan.Management.dll-help.xml" HelpInfoFiles = "Microsoft.WsMan.Management_766204A6-330E-4263-A7AB-46C87AFC366C_HelpInfo.xml" CompressedFiles = "Microsoft.WsMan.Management_766204A6-330E-4263-A7AB-46C87AFC366C_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\en-US" + HelpInstallationPath = "$PSHOME\en-US" HelpInstallationPathHome = "$userHelpRoot\en-US" } @@ -129,7 +129,7 @@ $testCases = @{ HelpFiles = "Microsoft.PowerShell.PackageManagement.dll-help.xml" HelpInfoFiles = "PackageManagement_4ae9fd46-338a-459c-8186-07f910774cb8_HelpInfo.xml" CompressedFiles = "PackageManagement_4ae9fd46-338a-459c-8186-07f910774cb8_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\Modules\PackageManagement\en-US" + HelpInstallationPath = "$PSHOME\Modules\PackageManagement\en-US" HelpInstallationPathHome = "$userHelpRoot\PackageManagement\en-US" } @@ -137,7 +137,7 @@ $testCases = @{ HelpFiles = "PSGet.psm1-help.xml" HelpInfoFiles = "PowershellGet_1d73a601-4a6c-43c5-ba3f-619b18bbb404_HelpInfo.xml" CompressedFiles = "PowershellGet_1d73a601-4a6c-43c5-ba3f-619b18bbb404_en-US_helpcontent$extension" - HelpInstallationPath = "$pshome\Modules\PowershellGet\en-US" + HelpInstallationPath = "$PSHOME\Modules\PowershellGet\en-US" HelpInstallationPathHome = "$userHelpRoot\PackageManagement\en-US" } } diff --git a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 index a488b7e745..c6150d2f15 100644 --- a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 @@ -237,7 +237,7 @@ Describe "Tests for circular references in required modules" -tags "CI" { Describe "Test-ModuleManifest Performance bug followup" -tags "CI" { BeforeAll { $TestModulesPath = [System.IO.Path]::Combine($PSScriptRoot, 'assets', 'testmodulerunspace') - $PSHomeModulesPath = "$pshome\Modules" + $PSHomeModulesPath = "$PSHOME\Modules" # Install the Test Module if (Test-CanWriteToPsHome) { @@ -250,7 +250,7 @@ Describe "Test-ModuleManifest Performance bug followup" -tags "CI" { $job = start-job -name "job1" -ScriptBlock {test-modulemanifest "$using:PSHomeModulesPath\ModuleWithDependencies2\2.0\ModuleWithDependencies2.psd1" -verbose} | Wait-Job $verbose = $job.ChildJobs[0].Verbose.ReadAll() - # Before the fix, all modules under $pshome will be imported and will be far more than 15 verbose messages. However, we cannot fix the number in case verbose message may vary. + # Before the fix, all modules under $PSHOME will be imported and will be far more than 15 verbose messages. However, we cannot fix the number in case verbose message may vary. $verbose.Count | Should -BeLessThan 15 } diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index 85a393633d..195e17f0d6 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -330,7 +330,7 @@ function Test-CanWriteToPsHome $script:CanWriteToPsHome = $true try { - $testFileName = Join-Path $PSHome (New-Guid).Guid + $testFileName = Join-Path $PSHOME (New-Guid).Guid $null = New-Item -ItemType File -Path $testFileName -ErrorAction Stop } catch [System.UnauthorizedAccessException] { diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index fb82e031f5..5eadc64d98 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -122,9 +122,9 @@ Function Remove-Destination([string] $Destination) { if (Test-Path -Path "$Destination.old") { Remove-Item "$Destination.old" -Recurse -Force } - if ($IsWinEnv -and ($Destination -eq $PSHome)) { + if ($IsWinEnv -and ($Destination -eq $PSHOME)) { # handle the case where the updated folder is currently in use - Get-ChildItem -Recurse -File -Path $PSHome | ForEach-Object { + Get-ChildItem -Recurse -File -Path $PSHOME | ForEach-Object { if ($_.extension -eq "old") { Remove-Item $_ } else { @@ -500,7 +500,7 @@ try { if (-not $UseMSI) { Write-Host "PowerShell has been installed at $Destination" -ForegroundColor Green - if ($Destination -eq $PSHome) { + if ($Destination -eq $PSHOME) { Write-Host "Please restart pwsh" -ForegroundColor Magenta } } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index bee0dea4c6..e7ed359225 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1618,7 +1618,7 @@ function New-ILNugetPackage if ($file -eq "Microsoft.PowerShell.SDK.dll") { - # Copy the '$PSHome\ref' folder to the NuGet package, so 'dotnet publish' can deploy the 'ref' folder to the publish folder. + # Copy the '$PSHOME\ref' folder to the NuGet package, so 'dotnet publish' can deploy the 'ref' folder to the publish folder. # This is to make 'Add-Type' work in application that hosts PowerShell. $contentFolder = New-Item (Join-Path $filePackageFolder "contentFiles\any\any") -ItemType Directory -Force