Move cleanup to seperate build step
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -8,8 +8,6 @@ Param(
|
||||
[string]$VSphereUsername,
|
||||
[Parameter(Mandatory)]
|
||||
[string]$VSpherePassword,
|
||||
[Parameter(Mandatory)]
|
||||
[string]$BuildName
|
||||
)
|
||||
|
||||
$PowerCliConfigurationSplat = @{
|
||||
@ -29,7 +27,7 @@ $ConnectVIServerSplat = @{
|
||||
Connect-VIServer @ConnectVIServerSplat | Out-Null
|
||||
|
||||
$GetVMSplat = @{
|
||||
Name = "$($VMName)*"
|
||||
Name = "*$($VMName)*"
|
||||
ErrorAction = 'SilentlyContinue'
|
||||
}
|
||||
If ([boolean](Get-VM @GetVMSplat)) {
|
||||
@ -45,7 +43,7 @@ If ([boolean](Get-VM @GetVMSplat)) {
|
||||
Disconnect-VIServer * -Confirm:$False
|
||||
|
||||
$RemoveItemSplat = @{
|
||||
Path = "/scratch/$($BuildName)/*"
|
||||
Path = "/scratch/*"
|
||||
Recurse = $True
|
||||
Force = $True
|
||||
Confirm = $False
|
||||
|
Reference in New Issue
Block a user