Skip to content

Commit fc0e3bc

Browse files
Orca88TravisEz13
authored andcommitted
Make Install-PowerShellRemoting.ps1 handle empty string in PowerShellHome parameter (PowerShell#10526)
When PowerShellHome is not specified as a runtime parameter to Install-PowerShellRemoting.ps1, the check '-ne $null' is actually an empty string. Properly checking with [String]::IsNullOrEmpty() solves the problem.
1 parent 62d0db2 commit fc0e3bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/powershell-native/Install-PowerShellRemoting.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ function Install-PluginEndpoint {
123123
# Install the plugin #
124124
# #
125125
######################
126-
127-
if ($PowerShellHome -ne $null)
126+
127+
if (-not [String]::IsNullOrEmpty($PowerShellHome))
128128
{
129129
$targetPsHome = $PowerShellHome
130130
$targetPsVersion = & "$targetPsHome\pwsh" -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'

0 commit comments

Comments
 (0)