[macOS] Improve select datastore script (#1892)

* modify script to set tages

* add vmname

* nitpicks

* add remove tag
This commit is contained in:
Mikhail Timofeev
2020-10-26 14:37:18 +03:00
committed by GitHub
parent 16ff1bc8a8
commit 47eaa69646
3 changed files with 75 additions and 26 deletions

View File

@@ -48,6 +48,13 @@ Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking
# Connection to a vCenter Server system
Connect-VCServer
# Clear previously assigned tag with VM Name
try {
Remove-Tag $VMName -Confirm:$false
} catch {
Write-Host "Tag with $VMName doesn't exist"
}
$vm = Get-VM $VMName
if ($env:AGENT_JOBSTATUS -eq 'Failed') {