Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 6bb88c8

Browse files
committed
Starting on a CleanAll task
1 parent 7831372 commit 6bb88c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.build.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,21 @@ task Cleanup {
235235
}
236236
}
237237

238+
task CleanAll {
239+
foreach ($VM in $Config.virtualMachines) {
240+
# Check if there is already an existing live mount with the same name
241+
if ( $MountTest = (Get-RubrikMount -VMID (Get-RubrikVM -VM "$VM.name").id) | Where-Object {$_.total -ne 0} ) {
242+
$MountTest | ForEach-Object {
243+
If ( (Get-RubrikVM -ID $_ -EA 0).name -eq $VM.mountName ) {
244+
Write-Verbose -Message "$($Config.virtualMachines[$i].mountName) removing this live mount" -Verbose
245+
Remove-RubrikMount $_
246+
}
247+
}
248+
}
249+
}
250+
}
251+
252+
238253
task 1_Init `
239254
GetConfig
240255

0 commit comments

Comments
 (0)