Fix Restart-Computer to work on localhost when WinRM is not present (#9160)

This commit is contained in:
Aditya Patwardhan authored and GitHub committed 2019-03-19 14:18:29 -07:00
1 parent b4ebf63335
commit 0fe9af4856
2 files changed
+34 -11

No files matched your search

@@ -975,9 +975,15 @@ namespace System.Management.Automation
string computerName,
PSCredential credential,
string authentication,
bool isLocalHost,
CancellationToken cancellationToken,
PSCmdlet cmdlet)
{
if (isLocalHost)
{
return CimSession.Create(null);
}
var sessionOptions = new CimSessionOptions();
CimCredential cimCredentials = GetCimCredentials(authentication, credential);