Skip to content

Commit 653c24e

Browse files
add sanity check code
1 parent ee1637f commit 653c24e

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

docs/machines.md

+10
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
124124
.\setup-runner-windows.ps1 -Username $username -Password $password -PeerIp $machine1 -NewIpAddress $machine2 -RunnerLabels $labels
125125
```
126126

127+
### Final Sanity Check
128+
```PowerShell
129+
ping 'netperf-peer'
130+
$username = (Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon').DefaultUserName
131+
$password = (Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon').DefaultPassword | ConvertTo-SecureString -AsPlainText -Force
132+
$cred = New-Object System.Management.Automation.PSCredential ($username, $password)
133+
$Session = New-PSSession -ComputerName 'netperf-peer' -Credential $cred -ConfigurationName PowerShell.7
134+
# Make sure no errors in running any of these commands on the client machine
135+
```
136+
127137
## Linux Azure Configuration (Deprecated in favor of 1ES)
128138

129139
```Shell

setup-runner-windows.ps1

+15-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ param (
1818
[string]$RunnerLabels = "",
1919

2020
[Parameter(Mandatory = $false)]
21-
[switch]$SetupRemotePowershell
21+
[switch]$SetupRemotePowershell,
22+
23+
[Parameter(Mandatory = $false)]
24+
[switch]$SanityCheck
2225
)
2326

2427
Set-StrictMode -Version 'Latest'
@@ -91,3 +94,14 @@ if ($NewIpAddress) {
9194
} else {
9295
Write-Host "-NewIpAddress not provided. Skipping IP address setup."
9396
}
97+
98+
if ($SanityCheck) {
99+
$username = (Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon').DefaultUserName
100+
$password = (Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon').DefaultPassword | ConvertTo-SecureString -AsPlainText -Force
101+
$cred = New-Object System.Management.Automation.PSCredential ($username, $password)
102+
$Session = New-PSSession -ComputerName 'netperf-peer' -Credential $cred -ConfigurationName PowerShell.7
103+
# Make sure no errors in running any of these commands on the client machine
104+
$Session
105+
} else {
106+
Write-Host "-SanityCheck not set. Skipping sanity check."
107+
}

0 commit comments

Comments
 (0)