-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e667d09
commit 4cbf994
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<# | ||
.NOTES | ||
=========================================================================== | ||
Created by: Martin Gavanda | ||
Date: Apr 29, 2018 | ||
WWW: www.learnvmware.online | ||
=========================================================================== | ||
.SYNOPSIS | ||
Sample script to cleanup environment from previous Insta Clone VMs | ||
.DESCRIPTION | ||
Destroy 20 new Inte Clone VMs deployed by deploy-clone.ps1 | ||
#> | ||
|
||
Connect-VIServer -server 172.16.1.100 -user "administrator@vsphere.local" -password "MyPassword" | ||
foreach ($i in 1..20){ | ||
|
||
$newVM="InstaClone"+$i | ||
|
||
|
||
### DO NOT EDIT BEYOND HERE ### | ||
|
||
Get-VM -name "$newVM" | Stop-VM -Confirm:$false | ||
} | ||
|
||
foreach ($i in 1..20){ | ||
|
||
$newVM="InstaClone"+$i | ||
Remove-VM $newVM -DeleteFromDisk -Confirm:$false | ||
} | ||
Disconnect-VIServer -Confirm:$false |