diff --git a/packer/windowsserver2019.json b/packer/windowsserver2019.json index 2ba4fa0..aaa7d19 100644 --- a/packer/windowsserver2019.json +++ b/packer/windowsserver2019.json @@ -236,7 +236,8 @@ " -VMName '{{user `vm_guestos`}}-{{user `vm_name`}}' \\", " -VSphereFQDN '{{user `vcenter_server`}}' \\", " -VSphereUsername '{{user `vsphere_username`}}' \\", - " -VSpherePassword '{{user `vsphere_password`}}'" + " -VSpherePassword '{{user `vsphere_password`}}' \\", + " -BuildName '{{build_name}}'" ] } ]] diff --git a/scripts/Remove-Resources.ps1 b/scripts/Remove-Resources.ps1 index ee8f4cd..05ba9be 100644 --- a/scripts/Remove-Resources.ps1 +++ b/scripts/Remove-Resources.ps1 @@ -7,7 +7,9 @@ Param( [Parameter(Mandatory)] [string]$VSphereUsername, [Parameter(Mandatory)] - [string]$VSpherePassword + [string]$VSpherePassword, + [Parameter(Mandatory)] + [string]$BuildName ) $PowerCliConfigurationSplat = @{ @@ -43,7 +45,7 @@ If ([boolean](Get-VM @GetVMSplat)) { Disconnect-VIServer * -Confirm:$False $RemoveItemSplat = @{ - Path = '/scratch/*' + Path = "/scratch/$($BuildName)/*" Recurse = $True Force = $True Confirm = $False