VMware Cloud Community
wamatha
Contributor
Contributor
Jump to solution

Script to check Cisco VEM version on ESXi Host

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

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
wamatha
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos