"Run with PowerShell" feature runs as expected on Windows 8 computer. If we compare Registry value that defines a command that runs when we select "Run with PowerShell" on a contextual menu, we can see that commands are quite different. Why it fails on Windows 7 (and probably Server 2008/2008 R2; I haven't tested that)? -File and -Command parameters cannot be used in the same command.On Windows 8:C:\PS> Get-ItemProperty REGISTRY::HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\0\Command | Select -Expand "(default)"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -Command "if((Get-ExecutionPolicy ) -ne 'AllSigned'){ Set-ExecutionPolicy -Scope Process Bypass }; & '%1' %*On Windows 7: PS C:\> Get-ItemProperty REGISTRY::HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\0\Command | Select -Expand "(default)""C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-file" "%1" "-Command" "if((Get-ExecutionPolicy ) -ne AllSigned) { Set-ExecutionPolicy -Scope Process Bypass }"
Have you seen this problem before in this product?
Please wait...