PoshCode Archive  Artifact [2423e785c6]

Artifact 2423e785c69fa650f095b3b64774a16d0297fa3aa62ad62c3f1afc93515b032b:

  • File The-other-Post.ps1 — part of check-in [e48bba2452] at 2018-06-10 14:27:29 on branch trunk — http://halr9000.com/article/642 (user: unknown size: 607)

# encoding: ascii
# api: powershell
# title: The other Post
# description: http://halr9000.com/article/642
# version: 0.1
# license: CC0
# x-poshcode-id: 964
# x-archived: 2009-03-27T18:09:16
#
#
$insParm = '/s /v"/qn /norestart"' 
$updList = get-cluster -name $YouClusterNameHere | get-vm |
	where-object {$_.powerstate -eq "PoweredON"} |
		foreach-object { get-view $_.ID } |
			where { $_.guest.toolsstatus -match "toolsOld" } 
foreach ($uVM in $updList) 
{
	$uVM.name 
	$uVM.UpgradeTools_Task($insParm) 
	#Wait 30 seconds before starting another update task 
	Start-sleep -s 30 
}