New to PS, Question about Output Differences.

I’ve been having to learn quickly and on the fly while at work and I was pulling info from the servers and if I run the following script

$server = "usoss3" Get-WmiObject -class win32_logicaldisk -ComputerName $server | Select DeviceID, @{Name="FreeSpace";Expression={$_.FreeSpace/1GB -as [int]}},@{Name="Size";Expression={$_.Size/1GB -as [int]}}, VolumeName | Format-Table -AutoSize | Export-CSV -path 'C:UsersmynamehereDesktopServerInfo.csv' 

I get the following results:

#TYPE Microsoft.PowerShell.Commands.Internal.Format.FormatStartData "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" "033ecb2bc07a4d43b5ef94ed5a35d280",,,"Microsoft.PowerShell.Commands.Internal.Format.AutosizeInfo","Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", "9e210fe47d09416682b841769c78b8a3",,,,, "27c87ef9bbda4f709f6b4002fa4af63c",,,,, "27c87ef9bbda4f709f6b4002fa4af63c",,,,, "27c87ef9bbda4f709f6b4002fa4af63c",,,,, "27c87ef9bbda4f709f6b4002fa4af63c",,,,, "27c87ef9bbda4f709f6b4002fa4af63c",,,,, "27c87ef9bbda4f709f6b4002fa4af63c",,,,, "4ec4f0187cb04f4cb6973460dfe252df",,,,, "cf522b78d86c486691226b40aa69e95c",,,,, 

But if I run it without the Export I get the actual results I want. What causes this and how could I go about fixing this issue.

DeviceID FreeSpace Size VolumeName -------- --------- ---- ---------- C: 12 55 D: 43 200 Central LN/TNSNAMES E: 19 2567 Network Shares F: 15 281 Backup G: 45 50 Roaming Profiles Z: 0 0 

submitted by /u/sharkainbow
[link] [comments]

Leave a Reply