This commit is contained in:
parent
2790b9c9d9
commit
961624998b
@ -218,12 +218,12 @@
|
|||||||
"type": "shell-local",
|
"type": "shell-local",
|
||||||
"inline": [
|
"inline": [
|
||||||
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
|
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
|
||||||
" -OVFFile '/scratch/output-srv2019-v/{{user `vm_guestos`}}-{{user `vm_name`}}.ovf' \\",
|
" -OVFFile '/scratch/srv2019-v/{{user `vm_guestos`}}-{{user `vm_name`}}.ovf' \\",
|
||||||
" -Parameter @{'appliance.name'='{{user `vm_guestos`}}';'appliance.version'='{{user `vm_name`}}'}\"",
|
" -Parameter @{'appliance.name'='{{user `vm_guestos`}}';'appliance.version'='{{user `vm_name`}}'}\"",
|
||||||
"pwsh -file scripts/Update-Manifest.ps1 \\",
|
"pwsh -file scripts/Update-Manifest.ps1 \\",
|
||||||
" -ManifestFileName '/scratch/output-srv2019-v/{{user `vm_guestos`}}-{{user `vm_name`}}.mf'",
|
" -ManifestFileName '/scratch/srv2019-v/{{user `vm_guestos`}}-{{user `vm_name`}}.mf'",
|
||||||
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
|
||||||
" '/scratch/output-srv2019-v/{{user `vm_guestos`}}-{{user `vm_name`}}.ovf' \\",
|
" '/scratch/srv2019-v/{{user `vm_guestos`}}-{{user `vm_name`}}.ovf' \\",
|
||||||
" /output/Windows-Server-2019-LTSC.ova"
|
" /output/Windows-Server-2019-LTSC.ova"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -26,14 +26,20 @@ $ConnectVIServerSplat = @{
|
|||||||
}
|
}
|
||||||
Connect-VIServer @ConnectVIServerSplat | Out-Null
|
Connect-VIServer @ConnectVIServerSplat | Out-Null
|
||||||
|
|
||||||
$RemoveVMSplat = @{
|
$GetVMSplat = @{
|
||||||
|
VM = "$($VMName)*"
|
||||||
|
ErrorAction = 'SilentlyContinue'
|
||||||
|
}
|
||||||
|
If ([boolean](Get-VM @GetVMSplat)) {
|
||||||
|
$RemoveVMSplat = @{
|
||||||
VM = "$($VMName)*"
|
VM = "$($VMName)*"
|
||||||
DeletePermanently = $True
|
DeletePermanently = $True
|
||||||
Confirm = $False
|
Confirm = $False
|
||||||
ErrorAction = 'SilentlyContinue'
|
ErrorAction = 'SilentlyContinue'
|
||||||
|
}
|
||||||
|
Remove-VM @RemoveVMSplat
|
||||||
}
|
}
|
||||||
Remove-VM @RemoveVMSplat
|
|
||||||
|
|
||||||
# Also delete ISO/floppy?
|
|
||||||
|
|
||||||
Disconnect-VIServer * -Confirm:$False
|
Disconnect-VIServer * -Confirm:$False
|
||||||
|
|
||||||
|
# Delete scratch folder contents
|
||||||
|
Loading…
Reference in New Issue
Block a user