line: Get-PSDrive C | Select-Object @{Name=”Free Disk Space percentage in GB”; Expression={($_.Free / 1GB * 100) / ($_.Used / 1GB + $_.Free / 1GB)}}
I’m trying to build a short script to execute on remote computers, but I’d like the output brief and to the point, I want it to read Free Disk Space percentage in GB I.E. 55.xx
I’m going to use the invoke-command cmdlet for the remote part. I thought I would use “{0:N2}” -f. I included it in the line but it did not do anything, the output remained 55.1234567890.
I’d appreciate any help, more to the point: what topic I should study to be better versed. I find that I learn better by solving an issue than by methodically studying the book from cover to cover. in this case, I want to learn how to control decimal points.