Closed dwalker3rd closed 10 months ago
$ignoreOutput = Enable-PSRemoting -skipnetworkprofilecheck -force $winRmService = Get-Service+ WinRM $winRmRuntime = (Get-Date -AsUTC) - $winRmService.CreationDate if ($winRmRuntime -gt (New-TimeSpan -Seconds 15)) { Stop-Service WinRM -Force $ignoreOutput = Enable-PSRemoting -skipnetworkprofilecheck -force $winRmService = Get-Service+ WinRM $winRmRuntime = (Get-Date -AsUTC) - $winRmService.CreationDate } if ($winRmService.State -ne "Running") { Start-Service WinRM }