When exporting it exports everything.Also, you need to add the paramater -NoTypeInformation to get rid of the first row.
#Disk Space
Get-Volume
$results = Get-Volume | Export-Csv -Path C:\temp\software1.csv
To only get certain values, you will just pipe it using select.. something like this:
Also, there is no need to do $results = get-volume... This pushes the output into the variable $results. This would be applicable if you wanted to recall the variable later. So, you could also do something like this..
先谢谢朋友们:)
Get-Volume | ft
Get-Volume | select HealthStatus, DriveLetter, SizeRemaining,DriveType | Export-Csv -NoTypeInformation -Path C:\temp\software1.csv
我用了下面的,它给出了一些不同的excel,请帮我这个#Disk Space Get-Volume $results = Get-Volume。