PowerShell and .Net Binding

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
vashachiroku
Posts: 96
Last visit: Tue Feb 28, 2012 1:03 am

PowerShell and .Net Binding

Post by vashachiroku »

Hello, FYI I'm still very new to PoSH, but I am getting there. Each day I take a script I find on the net and dissect it one part at a time. I've gotten better at identifying things, syntax, code, etc. Being I'm not a programmer or have done no scripting prior to this .Net, Com, and WMI stuff I still get caught on.I was looking over a script and here is a small part of itLabel="Max disk utilization" ;
expression={ "{0:n0}"-f ($_.DiskPercent ) + " %"}
},Could someone point me to a link that can explain that a bit more. I searched around and it has something to do with Binding, I dont understand the syntax and Google/Bing/MSDN I couldnt find a list of all the different options and syntax. I figured out that without it you cant combine the $_.DiskPercent + %, its just blank, so this has something to do with binding an int with a string.Any help would be great!ThanksJoel
User avatar
vashachiroku
Posts: 96
Last visit: Tue Feb 28, 2012 1:03 am

PowerShell and .Net Binding

Post by vashachiroku »

Jvierra thanks for the reply, but wasnt what I was looking for.{0:n0}{0:n2}I'm trying to understand that syntax, what it is, what it does, why and also the different in the n0 and the n2.Thanks
User avatar
vashachiroku
Posts: 96
Last visit: Tue Feb 28, 2012 1:03 am

PowerShell and .Net Binding

Post by vashachiroku »

Thats what I need, I completely understand it now. I figured out what it did by playing around with it more and testing some things. I just needed to understand what all the syntax was which is what I was having a problem finding!Thanks
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked