Is there a case statement equivalent in powershell to find the exit code of $proc ? How do we do that ?
by DonJ at 2013-02-02 10:06:18
Well, in terms of the argument being too long, I don't know what to tell you. If that's the argument that the command needs, it doesn't really matter how long it is. And, that's the correct way to pass the argument. You don't need to make it into an array – PowerShell would do that implicitly. I mean, you could use an actual array @("-Xmx512m","-jar c:\test\test.jar","-mode=silent") and so on. But that won't make it shorter.
PowerShell does have a Switch construct that works similarly to a case construct. Read "about_switch" in the shell's help.