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.
I tried using “{0:N2}” -f and I expected it would format the output to 2 decimal points, I studied where I should insert the expression which was between the second braces, and start it with a parenthesis, and then closed parentheses before the second braces. but it did nothing, the output remained the same, no ‘blood on the screen’ either, it did nothing.
Manuel Orellana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.