-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhpe.ps1
More file actions
25 lines (24 loc) · 825 Bytes
/
Copy pathhpe.ps1
File metadata and controls
25 lines (24 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if ($args[0] -eq '--shutdown') {
& $PSScriptRoot\shutdown.ps1
# block terminal until operation is completed fully
do {
Start-Sleep -Seconds 1
} until (
$null -eq [System.Environment]::GetEnvironmentVariable('KaliHyperVAddr', 'User')
)
}
elseif ($args.Length -eq 0) {
# check if vm already booted
if (($null -eq [System.Environment]::GetEnvironmentVariable('KaliHyperVAddr', 'User')) ) {
& $PSScriptRoot\startUp.ps1
# block terminal until operation is completed fully
do {
Start-Sleep -Seconds 1
} until (
$null -ne [System.Environment]::GetEnvironmentVariable('KaliHyperVAddr', 'User')
)
}
# ssh into machine
$ip = [System.Environment]::GetEnvironmentVariable('KaliHyperVAddr', 'User')
ssh kss@$ip
}