PS> c:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -name versioninfo
Obviously a huge typ-o --caused the shell to become completely unresponsive, no error or any kind of onscreen feedback was provided, with the exception of a blinking prompt. Should an error or some type of exception been generated?
Win-11 \ Home
I don’t really know what to tell you here. The -Name
parameter isn’t a documented parameter of powershell.exe. You can call it with any value and the behavior is the same: session locks up.
But if you throw an obviously made up parameter name at powershell.exe you get an error that you’d expect
PS$> c:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -waffles
-waffles : The term '-waffles' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ -waffles
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (-waffles:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
There’s no documentation on a -Name parameter and it’s not a partial match for another parameter. I guess I’d just stop doing that?
@grey0ut – I probably will “stop doing that”. The query was an attempt to know if, for something like this, should I have received a error || exception
or, other than my obvious typ-o, was this an issue with PS 5.1 --not generating the onscreen error, similar to your above example.
In the first posted example, I copy-n-pasted, forgetting to enter the initial cmdlet. :-/
Thank you again for the reply. Have a healthy 2025.