forked from lucabol/DTLCustomImagesLab
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Remove-Vms.ps1
19 lines (13 loc) · 820 Bytes
/
Remove-Vms.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
param
(
[Parameter(Mandatory=$false, HelpMessage="Configuration File, see example in directory")]
[string] $ConfigFile = "config.csv",
[Parameter(Mandatory=$false, HelpMessage="How many Seconds to wait before starting the next parallel vm deletion")]
[int] $SecondsToNextVmDeletion = 5,
[Parameter(HelpMessage="Example: 'ID-*,CSW2-SRV' , a string containing comma delimitated list of patterns. The script will (re)create just the VMs matching one of the patterns. The empty string (default) recreates all labs as well.")]
[string] $ImagePattern = ""
)
$ErrorActionPreference = "Stop"
. "./Utils.ps1"
Import-AzDtlModule
"./Remove-Vm.ps1" | Invoke-RSForEachLab -ConfigFile $ConfigFile -SecondsBetweenLoop $SecondsToNextVmDeletion -ImagePattern $ImagePattern -ModulesToImport $AzDtlModulePath