Skip to content

Commit

Permalink
Make Install-PowerShellRemoting.ps1 handle empty string in `PowerSh…
Browse files Browse the repository at this point in the history
…ellHome` 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.
  • Loading branch information
Orca88 authored and TravisEz13 committed Sep 16, 2019
1 parent 62d0db2 commit fc0e3bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/powershell-native/Install-PowerShellRemoting.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ function Install-PluginEndpoint {
# Install the plugin #
# #
######################

if ($PowerShellHome -ne $null)
if (-not [String]::IsNullOrEmpty($PowerShellHome))
{
$targetPsHome = $PowerShellHome
$targetPsVersion = & "$targetPsHome\pwsh" -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
Expand Down

0 comments on commit fc0e3bc

Please sign in to comment.