VMware Cloud Community
prlyons
Contributor
Contributor
Jump to solution

Problem with $_.ID

Any ideas why this doesn't work:

PS C:\Documents and Settings\plyons\Desktop> get-vm | %{(Get-View $_.ID).Guest.T

oolsStatus}

Get-View : A parameter cannot be found that matches parameter name 'VirtualMach

ine-vm-3120'.

At line:1 char:21

+ get-vm | %{(Get-View <<<< $_.ID).Guest.ToolsStatus}

Get-View : A parameter cannot be found that matches parameter name 'VirtualMach

ine-vm-4020'.

At line:1 char:21

+ get-vm | %{(Get-View <<<< $_.ID).Guest.ToolsStatus}

Get-View : A parameter cannot be found that matches parameter name 'VirtualMach

ine-vm-3112'.

PS C:\Documents and Settings\plyons\Desktop> get-vm | ft name,ID

Name ID

-


--

vm-img-win VirtualMachine-vm-3120

vm-oes-serv1 VirtualMachine-vm-4020

vm-clark VirtualMachine-vm-3112

Any insight would be greatly appreciated.

Thanks,

Paul

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Are you sure you're running the Beta build? Do you have a cmdlet called Get-VIToolkitVersion?

FWIW, the script works for me:

PS> get-vm | %{(Get-View $_.ID).Guest.ToolsStatus}

toolsNotRunning

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsOk

View solution in original post

0 Kudos
4 Replies
admin
Immortal
Immortal
Jump to solution

Are you sure you're running the Beta build? Do you have a cmdlet called Get-VIToolkitVersion?

FWIW, the script works for me:

PS> get-vm | %{(Get-View $_.ID).Guest.ToolsStatus}

toolsNotRunning

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsNotInstalled

toolsOk

0 Kudos
prlyons
Contributor
Contributor
Jump to solution

I thought I was, but now I'm not so sure:

PS C:\Documents and Settings\plyons\Desktop> Get-VIToolkitVersion

The term 'Get-VIToolkitVersion' is not recognized as a cmdlet, function, operable program, or script file. Verify the t

erm and try again.

At line:1 char:20

+ Get-VIToolkitVersion <<<<

0 Kudos
admin
Immortal
Immortal
Jump to solution

I thought I was, but now I'm not so sure:

PS C:\Documents and Settings\plyons\Desktop> Get-VIToolkitVersion

The term 'Get-VIToolkitVersion' is not recognized as a cmdlet, function, operable program, or script file. Verify the t

erm and try again.

At line:1 char:20

+ Get-VIToolkitVersion <<<<

You definately have our earlier tech preview then. If you install the Beta your script will work.

prlyons
Contributor
Contributor
Jump to solution

My bad, was running older version.

Thanks for the help!

Paul

0 Kudos