You can write functions like this:
function Start-SR4 {
start-vm -VM PRIM-SERVER,SEC-SERVER -RunAsync
start-sleep -Seconds 30
start-vm -VM CLIENT1,CLIENT2,CLIENT3,CLIENT4 -RunAsync
}
function Stop-SR4 {
Stop-VMGuest -Confirm:$false -VM CLIENT1,CLIENT2,CLIENT3,CLIENT4
start-sleep -Seconds 30
Stop-VMGuest -Confirm:$false -VM PRIM-SERVER,SEC-SERVER
}
This leverages the previous reply with the command line info.
The delay is in case you need time for the clients to disconnect from the servers.
Does anyone know why the -Confirm switch requires the colon as in -Confirm:$false, instead of -Confirm $false?
This gave me some trouble.