I'm in need of a PowerCLI script to get the ESXi host OS version with build number for the required servers (input should be taken from a text file) and
output to be captured in a .csv file, kindly help...
TIA
Try something like this
Select Name,Version,Build |
Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Select Name,Version,Build |
Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Please and thank you go a long way, but here ya go:
$csvFile = [Path to csv file]
$hosts = Import-CSV -path $csvFile
$output = @()
forEach ($line in $hosts) {
$hostname = $line.hostname
$outPut += (Get-VMHost $hostname | Select-Object name,version, build)
}
$output | Export-CSV [Path to export file] -force