Add null host name check in WSMan (#11288)

This commit is contained in:
Ilya
2019-12-09 10:52:03 -08:00
committed by Andrew
parent bcc565603c
commit 12bf5306e2
2 changed files with 9 additions and 0 deletions
@@ -1446,6 +1446,11 @@ namespace Microsoft.WSMan.Management
// Get the wsman host name to find the session object
string host = GetHostName(path);
if (string.IsNullOrEmpty(host))
{
return false;
}
string WsManURI = NormalizePath(path, host);
lock (WSManHelper.AutoSession)
@@ -77,6 +77,10 @@ Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows {
}
}
}
It "Container check works" {
Test-Path wsman:\foo -PathType container | Should -BeFalse
}
}
Context "Get-Item tests" {