November 6, 2013 at 12:42 pm #11218
I'm trying to run a script written by someone else off of a network share. I'm executing it from a command line with the syntax powershell -executionpolicy bypass -file \\server\share\script.ps1. I get an error that the file is not digitally signed.
I'm confused as to why isn't it bypassing the executionpolicy?
November 6, 2013 at 12:48 pm #11220
Run this command at a PowerShell console, and post the results:
It's possible that execution policy is being assigned to you via Group Policy; if that's the case, you can't override it with the -ExecutionPolicy parameter. This is from the about_Execution_Policies help file:
EXECUTION POLICY PRECEDENCE
When determining the effective execution policy for a
session, Windows PowerShell evaluates the execution policies
in the following precedence order:
– Group Policy: Computer Configuration
– Group Policy: User Configuration
– Execution Policy: Process (or PowerShell.exe -ExecutionPolicy)
– Execution Policy: CurrentUser
– Execution Policy: LocalMachine
November 6, 2013 at 12:55 pm #11223
November 6, 2013 at 1:47 pm #11226
It gets stranger. I wrote a 1 liner 'Hello Word' script and saved it to my personal network share, and tried to run it on the same computer, using bypass -file; worked like a hero.
I copied the exact same script to the network share of the script that won't run, and now the same script gives me the error that my script is not signed. Hurr?
November 6, 2013 at 2:49 pm #11229
Yep, you've got RemoteSigned coming from Group Policy. Unless you'll be allowed to change that, you'll need to sign any script that's run from a UNC path like that.
November 7, 2013 at 6:19 am #11265
Network shares are considered remote not local. I have run into the same problem too. Even if it's a mapped drive letter it is still "remote"
You must be logged in to reply to this topic.