/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Continuing my adventure with developing for a 64-bit XP environment. Has anyone installed PowerShell into this environment, and if so, how do I get the Execution Policy changed from Restricted to Remote Signed?

I'm installing PowerShell along with some other apps and using Wise Package Studio 8 to create an exe that does everything I want. With regards to PowerShell, I install it, then am trying to change the Execution Policy so I can run some scripts.

So far I've tried this code directly in Wise Script Editor:

item: Execute Program
Pathname=%SYS32%\windowspowershell\v1.0\powershell.exe
Command Line=-nologo -executionpolicy bypass -noprofile -file "script.ps1"
Flags=00000010
end


Then I tried this as a .bat and a .cmd file and executed it via my Wise script:

"C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" Set-ExecutionPolicy RemoteSigned


Then I tried compiling the batch file to an exe and executing that in my Wise script.

But in the end, same result: never works in Wise. The cmd and bat files work if I run them on the target PC, but if I try firing them from my Wise script, no luck. The exe doesn't work at all, possibly because of the compiler I used, but just guessing.

Any suggestions?
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
i would suggest you look here.

www.powershell.com there is a pretty good admin guide for general powershell tips such as this.
Answered 05/08/2011 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
0
Could it be that the issue here might be related to a previous post you made on Appdeploy ? As I said in my reply to that post, it is my understanding that compiled WiseScript executables always run in 32-bit mode, so this might account for the different behaviour you are seeing.

Regards

Spartacus
Answered 05/09/2011 by: spartacus
Black Belt

Please log in to comment