Fixlet Failing when adding powershell parameter

Hello,

I am trying to set in all our computers the executionpolicy hardcoded, and install two new modules. However, it is failing. Don’t know what am I missing.

Failed waithidden "{parameter "PowerShellexe"}" -ExecutionPolicy Bypass -command "set-executionpolicy remotesigned -Force" waithidden "{parameter "PowerShellexe"}" -ExecutionPolicy Bypass -Command "Install-Module -Name BurntToast -Force" waithidden "{parameter "PowerShellexe"}" -ExecutionPolicy Bypass -Command "Install-Module -Name PSModule -Force" waithidden "{parameter "PowerShellexe"}" -ExecutionPolicy Bypass -Command "Import-Module -Name PSModule -Force" waithidden "{parameter "PowerShellexe"}" -ExecutionPolicy Bypass -Command "Import-Module -Name BurntToast -Force"

Did you define the parameter "PowerShellexe" earlier in the script?

I think this one is my bad. I had the commented out the line…
parameter “PowerShellexe”="{value “Path” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell” of x64 registry}"

Jason, is still getting stuck when trying to set the execution policy remotesigned.

Can be multiple reasons - might be helpful if you posted the entire script, if you can :wink:
Also note the 32 vs 64 bit issue, which can be fixed by adding (which i copied from @jgstew post)

action uses wow64 redirection {not x64 of operating system}

If you don’t use that line, then it will always use 32bit powershell. If you use that line, then it will use 32bit powershell on 32bit systems and 64bit powershell on 64bit systems. You just have to comment out that line if you need it to always use 32bit powershell.

2 Likes