Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 57bda5e

Browse files
author
Jason Helmick
authored
Merge pull request #9 from jdhitsolutions/master
Modified TrustedHosts code
2 parents 6b490f3 + cfef0fc commit 57bda5e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Setup-Host.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,27 @@ Write-Host -ForegroundColor Green -Object @"
2626
Pause
2727

2828

29-
# For remoting commands to VM's - have the host set trustedhosts to *
29+
# For remoting commands to VM's - have the host set trustedhosts
3030

31-
Write-Host -ForegroundColor Cyan -Object "Setting TrustedHosts to * so that remoting commands to VM's work properly"
32-
$trust = Get-Item -Path WSMan:\localhost\Client\TrustedHosts
31+
Write-Host -ForegroundColor Cyan -Object "Setting TrustedHosts so that remoting commands to VMs work properly"
32+
$trust = Get-Item -Path WSMan:\localhost\Client\TrustedHosts
33+
if ($Trust.Value -eq "*") {
34+
Write-Host -ForegroundColor Green -Object "TrustHosts is already set to *. No changes needed"
35+
}
36+
else {
37+
$add = 'DC,S*,Client*,192.168.3.'
38+
Write-Host -ForegroundColor Cyan -Object "Adding $add to TrustedHosts"
39+
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value $add -Concatenate -force
40+
}
41+
<#
3342
If ($trust.value -eq "" -or $trust.value -eq "*"){
3443
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value * -Force
3544
} Else {
3645
Write-Warning "Your system is not a default installation -- "
3746
Write-Warning "Your trustedhosts has a value $($trust.Value)"
3847
break
3948
}
49+
#>
4050

4151
# Lability install
4252
Write-Host -ForegroundColor Cyan "Installing Lability for the lab build"

0 commit comments

Comments
 (0)