wamatha
Contributor
Contributor

Script to check Cisco VEM version on ESXi Host

Jump to solution

Hallo there,

I need help, a script to check and report to a cvs file the Cisco Nexus 1000v VEM version on all ESXi hosts connected to a vCenter.

basically, 'vem version -v' but for all the ESXi hosts connected to a vCenter.

Thanks

Joseph

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

I suspect you might be using PowerShell v1, in that version the Export-Csv didn't have the UseCulture parameter.

Try running the script without that parameter.

But I would strongly advise you to upgrade your PowerShell version (v3 is available)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership

Try something like this

Get-VirtualSwitch -Distributed | 
where {$_.ExtensionData.Summary.ProductInfo.Vendor -like "Cisco*"} | 
Select Name,   @{N="Version";E={$_.ExtensionData.Summary.ProductInfo.Version}},
  @{N="Hosts";E={[string]::JoIn(',',(Get-View $_.ExtensionData.Summary.HostMember | Select -ExpandProperty Name))}} |
Export-Csv
C:\report.csv -NoTypeInformation -UseCulture


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
wamatha
Contributor
Contributor

Thank you Luc,

I get the error below when I run the script

Export-Csv : A positional parameter cannot be found that accepts argument 'Scripts\report.csv'.
At C:\_LOCALdata\Powershell Scripts\vem_version_checker.ps1:7 char:11
+ Export-Csv <<<<  C:\_LOCALdata\Powershell Scripts\report.csv -NoTypeInformation -UseCulture
    + CategoryInfo          : InvalidArgument: (:) [Export-Csv], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.ExportCsvCommand

0 Kudos
LucD
Leadership
Leadership

I suspect you might be using PowerShell v1, in that version the Export-Csv didn't have the UseCulture parameter.

Try running the script without that parameter.

But I would strongly advise you to upgrade your PowerShell version (v3 is available)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos