mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add null host name check in WSMan (#11288)
This commit is contained in:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user