Created c:\\test.ps1 the following content:
\r
powershell-noexit "echo $args"
\r
Added to HKCU\\...\\test\\command\\@ next:
\r
C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -EP Bypass-File C:\\test.ps1 "%1"
\r
No difference when run exe and other files are not noticed. Generally speaking the more correct way of passing arguments to scripts — specifying the param block.
\r
test.ps1:
\r
param($FilePath) powershell-noexit "echo $FilePath"
HKCU\\...\\test\\command\\@:
\r
C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -EP Bypass-File C:\\test.ps1 -FilePath "%1"