I’m working on a small function and I’m getting hung-up on some of the output. What I have right now works perfectly for generating results in a nice clean report, my size conversion is all working, etc… but I need to add another column listing computer name as this script will target many machines. I’m thinking this is just a custom object property but since i would calling $ENV:Computername into that property…let me stop there. Hopefully someone knows what I’m trying to say
Using the “pipe something to Select-Object” approach of building a custom object, you’d just add a new property name to your Select-Object call (probably ComputerName), and then set it to $env:computername. Something like this:
One thing to keep in mind is that your “Size” field is now a string, not a number. Sort-Object might not work quite the way you expect in this situation. As far as strings are concerned, “2” is greater than “1000”.