1151
Developer's Corner / Command line argument processing
« Last post by Josh on April 10, 2010, 04:10 AM »To all the coders out there, I come to you with this inquiry.
I have recently delved into the wonderful world of powershell 2.0 for the Windows platform. I absolutely love its power, simplicity and extendability. My question is this. After programming assignment #2 from the programming school here at DC, I have started to wonder how others process command line arguments.
My primary question is how do you do this? Do you hard code each parameter into a big "switch" statement and cycle through each argument or do you use a dedicated function that processes arguments? I am wondering if I should delve into coding a powershell function to process command line arguments automatically or make it on a per script basis.
What are your thoughts? How do you handle command-line args?
I have recently delved into the wonderful world of powershell 2.0 for the Windows platform. I absolutely love its power, simplicity and extendability. My question is this. After programming assignment #2 from the programming school here at DC, I have started to wonder how others process command line arguments.
My primary question is how do you do this? Do you hard code each parameter into a big "switch" statement and cycle through each argument or do you use a dedicated function that processes arguments? I am wondering if I should delve into coding a powershell function to process command line arguments automatically or make it on a per script basis.
What are your thoughts? How do you handle command-line args?

Recent Posts