Link to home
Start Free TrialLog in
Avatar of Member_2_7966113
Member_2_7966113

asked on

How to Digitally Sign Powershell Script

Hello Experts,

I keep on getting the following error when I try to run a powershell script, see image. The problem appears to be because the .ps1 script isn't digitally signed.
User generated image
Can someone let me know how to digital sign the powershell script please?

Cheers

Carlton
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

You can always change execution policy to unrestricted and you won't need to sign it
Set-ExecutionPolicy Unrestricted

Open in new window

Just turn it back on after you have run the script
Set-ExecutionPolicy Default

Open in new window

Also here is guild to sign Powershell if you do not want to use above
http://www.hanselman.com/blog/SigningPowerShellScripts.aspx
Avatar of Member_2_7966113
Member_2_7966113

ASKER

Hi Shaun,

I ran the followingL

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass,

But now the script won't run at all. Please see attached for the script.

Any help will be appreciated.

Cheers
Test-VPNConnection.txt
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Qlemo

When I run the script I just get the following

PS C:\WINDOWS\system32> C:\Users\Carlton\Downloads\Azure Automation\Test-VPNConnection.ps1
Please understand, my basic knowledge of Powershell is very limited... I guess I'm trying to say is why won't the script run??
What you showed looks like the PS prompt, then the script name. Of course you pressed return? And then nothing happens?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
David is correct, I just wasn't able to spot that on mobile ...
Thanks guys