powershell command Line arguments get lost if directly running from CMD -
need help
example
working : c:\sdk>powershell testps1.ps1 a1 a2 a3
not working : c:\sdk>.\testps1.ps1 a1 a2 a3
in above examples both command runs script 2nd command running script without powershell prefix not capture argument in args .
powershell default app launcher ps1 extension .
script : testps1.ps1
--------------------------------------------
write-host "running script "
write-host $args
write-host "script completed!!"
--------------------------------------------
.\file open in default application. default supposed notepad.exe .ps1 files. class mapping .ps1 files has not been setup pass arguments. enabling potential security risk , not enabled default reason.
for how manually need in setting custom registry class .ps1 %1
Comments
Post a Comment