Hello,
I have a script which provides disk space in a bulk computers, but… the % column is missing the data, it’s appears as empty column. at the ISE console its shown well.
Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName (Get-Content C:\servers.txt) -Filter DriveType=3 |
Select-Object systemname,DeviceID,
@{'Name' = 'Size (GB)'; 'Expression' = { [string]::Format('{0:N0}', [math]::truncate($_.size / 1GB)) } },
@{'Name' = 'Free (GB)'; 'Expression' = { [string]::Format('{0:N0}', [math]::truncate($_.freespace / 1GB))}},
@{'Name' = '(%)'; 'Expression' = { [string]::Format('{0:P}', $_.freespace / $_.Size )}} | Out-GridView