Format output via Export-CSV to include spaces in row headers? I get errors when placing spaces in code.
How can I export data via export-csv to place spaces in header row? ie. in below script ... I need the VMName and IPAddress header rows to have spaces in them like "VM Name" and "IP Address"?
*****************
Get-VM | %{
$vmGuest = $_ | Get-VMGuest
$row = "" | Select VMName, State, OS, Host, CPU, IPAddress
$row.VMname = $_.Name
etc .....
You can place spaces in object properties like this:
Get-VM | %{
$vmGuest = $_ | Get-VMGuest
$row = "" | Select "VM Name", State, OS, Host, CPU, "IP Address"
$row."VM Name" = $_.Name
etc .....
Robert
You can place spaces in object properties like this:
Get-VM | %{
$vmGuest = $_ | Get-VMGuest
$row = "" | Select "VM Name", State, OS, Host, CPU, "IP Address"
$row."VM Name" = $_.Name
etc .....
Robert
