Hi,
i tried to build a script to discover the Versions of the installed VMWare-Tools on my Guest, display it and write it to an CSV-File.
Here´s the actual content:
$vmview = Get-VM |Sort-Object {$_.Name} | Get-View
$vmview.Config.Tools | Select ToolsVersion | Write-Host #|Export-CSV "C:
Script_Outputs\VM_Tools_Version_$wann.csv" -noTypeInformation
My problem is:
The script shows the Version of the installed tools, but it doesn´t show the name
How do i add the the Name to the script?
Thx in advance
Chakoe
Sure, something like this
Get-VM |Sort-Object {$_.Name} | Get-View | ` where {$_.Config.Tools.ToolsVersion -eq "7202"} | ` Select Name, @{N="Version";E={$_.Config.Tools.ToolsVersion}}
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can add the VM name to the script like this:
$vmview = Get-VM |Sort-Object {$_.Name} | Get-View $vmview | ForEach-Object { $Report = "" | Select-Object Name,ToolsVersion $Report.name = $_.Name $Report.ToolsVersion = $_.Config.Tools.Toolsversion $Report } | Export-CSV "C:\\Script_Outputs\VM_Tools_Version_$wann.csv" -noTypeInformation
Regards, Robert
You can do it like this
Get-VM |Sort-Object {$_.Name} | Get-View | Select Name, @{N="Version";E={$_.Config.Tools.ToolsVersion}}
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi,
the Script works fine.
Now there´s a new question:
Is it possible to seachr for all vm´s which have a ToolsVersion=7202 ?
Thx in advance
Chakoe
Sure, something like this
Get-VM |Sort-Object {$_.Name} | Get-View | ` where {$_.Config.Tools.ToolsVersion -eq "7202"} | ` Select Name, @{N="Version";E={$_.Config.Tools.ToolsVersion}}
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference