diff --git a/upi/vsphere/powercli/upi-destroy.ps1 b/upi/vsphere/powercli/upi-destroy.ps1 index 2511713c6f..feb5aa6a96 100644 --- a/upi/vsphere/powercli/upi-destroy.ps1 +++ b/upi/vsphere/powercli/upi-destroy.ps1 @@ -77,4 +77,6 @@ foreach ($policy in $storagePolicies) { # Clean up tags Remove-Tag -Tag $tag -confirm:$false -Remove-TagCategory -Category $tagCategory -confirm:$false \ No newline at end of file +Remove-TagCategory -Category $tagCategory -confirm:$false + +Disconnect-VIServer -Server $vcenter -Force:$true -Confirm:$false \ No newline at end of file diff --git a/upi/vsphere/powercli/upi.ps1 b/upi/vsphere/powercli/upi.ps1 index 4e2ffae16f..2fc10cff5f 100644 --- a/upi/vsphere/powercli/upi.ps1 +++ b/upi/vsphere/powercli/upi.ps1 @@ -517,5 +517,6 @@ if ($waitForComplete) Get-Job | Remove-Job +Disconnect-VIServer -Server $vcenter -Force:$true -Confirm:$false Write-Output "Install Complete!"