Reply to Message

View discussion in a popup

Replying to:
xybal
Enthusiast
Enthusiast

automate vmware tools upgrade / installation

Hi,

I've found this on a post on communities to automate vmware tools upgrade / install:

$installerArgs = 'REBOOT="ReallySuppress"'

Get-VM | % { (Get-View $_).UpgradeTools_Task($installerArgs) }

Variable initialisation happens witout any Pb, but when I copy the second line (with a VM name following Get-VM of course) it give me this :

C:\> Get-VM GQN00549 | % { (Get-View $_).UpgradeTools_Task($i

nstallerArgs) }

Get-View : 27/05/2010 15:59:19 Get-View Invalid object specified for

parameter Id - 'VirtualMachineImpl'. Valid types are ManagedObjectReference and

string.

At line:1 char:32

+ Get-VM GQN00549 | % { (Get-View <<<< $_).UpgradeTools_Task($installerArgs) }

+ CategoryInfo : InvalidArgument: (GQN00549:VirtualMachineImpl) [

Get-View], VimException

+ FullyQualifiedErrorId : Core_GetVIView_TryGetIdParam_InvalidValue,VMware

.VimAutomation.Commands.DotNetInterop.GetVIView

You cannot call a method on a null-valued expression.

At line:1 char:54

+ Get-VM GQN00549 | % { (Get-View $_).UpgradeTools_Task <<<< ($installerArgs) }

+ CategoryInfo : InvalidOperation: (UpgradeTools_Task:String) [],

RuntimeException

+ FullyQualifiedErrorId : InvokeMethodOnNull

I'm a newbie on powerCLI so is someone can debug this for me please ?

Thx

Reply
0 Kudos