Created
August 24, 2016 17:32
-
-
Save mikebranstein/231f2460e09aa5d53d4df8fd866a3ba0 to your computer and use it in GitHub Desktop.
Add multiple devices to the Trusted Hosts file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$trustedHosts = Get-Item WSMan:\localhost\Client\TrustedHosts | |
if ($trustedHosts.Value -eq "") { | |
Set-Item WSMan:\localhost\Client\TrustedHosts -Value $ipAddress -Force | |
} | |
elseif (-not $trustedHosts.Value.Contains($ipAddress)) { | |
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "$($trustedHosts.Value),$($ipAddress)" -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment