Pages: [1]
Print
Author Topic: list the build numbers of all your vmware hosts  (Read 3129 times)
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« on: May 21, 2009, 11:23:58 AM »

Code:
$FullName = @{ Label = "Product Full Name"; Expression = { (Get-View $_.ID).Config.Product.fullname } }
Get-VMHost | Sort-object name | ft name,$fullname 
Logged
aflora
Newbie
*
Posts: 16


View Profile
« Reply #1 on: June 01, 2009, 06:09:52 PM »

Hi esarakaitis

Cool script!. How would you pipe this script to an html file? I've used the Select-Object method but can't get it to work with Product full name.

Thanks
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #2 on: June 01, 2009, 07:57:04 PM »

well, im not sure... i've never used convertto-html

im guessing something like:

Code:
$FullName = @{ Label = "Product Full Name"; Expression = { (Get-View $_.ID).Config.Product.fullname } }
$data = Get-VMHost | Sort-object name | ft name,$fullname
$data | convertto-html > c:\index.html
« Last Edit: June 02, 2009, 06:46:49 AM by esarakaitis » Logged
aflora
Newbie
*
Posts: 16


View Profile
« Reply #3 on: June 02, 2009, 05:24:03 PM »

it's still not working. I get jibberish in the htm file.
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #4 on: June 03, 2009, 07:15:37 AM »

im getting the same jibberish as well... hmmm
Logged
OMGpwrshll
Newbie
*
Posts: 2


View Profile
« Reply #5 on: October 13, 2009, 11:45:12 AM »

Thx for posting this script esarakaitis.  I'm getting the following error when I run it though:

out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with the default formatting.
    + CategoryInfo          : InvalidData: (Smiley [out-lineoutput], InvalidOperationException
    + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand


Any thoughts?
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #6 on: October 13, 2009, 12:37:52 PM »

Thx for posting this script esarakaitis.  I'm getting the following error when I run it though:

out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with the default formatting.
    + CategoryInfo          : InvalidData: (Smiley [out-lineoutput], InvalidOperationException
    + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand


Any thoughts?

how about a screenshot? what version of powershell?
Logged
OMGpwrshll
Newbie
*
Posts: 2


View Profile
« Reply #7 on: October 13, 2009, 01:20:27 PM »

Thx for the quick response.  I found the problem.  I modified this script by adding an initial line to connect to my VM Host:

Connect-VIServer vmhost1


When I run the script this way, it throws the error I posted.  If I leave this line out and run your script as is (after initially connecting to my VMHost, of course) it works beautifully.
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #8 on: October 14, 2009, 06:51:40 AM »

none of my scripts contain a connect-viserver string. It is assumed that your already connected Smiley
Logged
Pages: [1]
Print
Jump to: