Questions tagged [executionpolicy]

A security setting for Windows PowerShell that enables you to determine which Windows PowerShell scripts (if any) will be allowed to run on your computer.

53 questions
123
votes
14 answers

Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

Since this question continues to attract responses that are either refuted by the question body or don't address the actual problem, please read this simple summary of what you need to know: This is not a "Why won't my default installation of…
Lance U. Matthews
  • 13,224
  • 6
  • 36
  • 62
14
votes
2 answers

Bypass vs Unrestricted execution policies

The documentation on the topic only provides this: Unrestricted. Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs. Bypass.…
scharette
  • 7,629
  • 6
  • 25
  • 58
5
votes
1 answer

Execution policy prompt the first time powershell script runs after reboot

I have a PowerShell script I wish to use to automate something. I run it by right clicking on it and choosing "Run with PowerShell". I have run Set-ExecutionPolicy Bypass in both 32- and 64-bit PowerShell, and verified it with…
Tor Klingberg
  • 4,070
  • 6
  • 31
  • 49
5
votes
1 answer

Why does PowerShell have an execution policy?

I understand sufficiently how the ExecutionPolicy works in PowerShell. Most of what I've seen and done is how to disable it. There's even a command-line flag to disable it (powershell -ExecutionPolicy Unrestricted ...). So my question is why, not…
William
  • 609
  • 5
  • 12
5
votes
1 answer

Run Only signed powershell scripts from c#

I have a windows service that downloads a script and then runs it. I've been trying to make my windows service more secure, making it accept only signed power-shell scripts. I have ran the Set-ExecutionPolicy AllSigned command on the server, and…
4
votes
2 answers

Entity Framework PowerShell script cannot be loaded by Visual Studio because its operation is blocked by software restriction policies

When I load Package Manager Console within Visual Studio 2017 v15.9.6 in a project that uses Entity Framework I receive the following error: \packages\EntityFramework.6.2.0\tools\init.ps1 cannot be loaded because its operation is blocked by…
4
votes
3 answers

Powershell Invoke-SQLCmd and SQLPS

Windows 7 workstation POSH 3.0 SS 2012 SP1 Abstract: Developer 1 cannot run Invoke-SQLCmd Developer 2 with similar SS Client tools installation can run Invoke-SQLCmd Developer 1 cannot run Import-Module SQLPS When I try to run a query from my…
Riskworks
  • 139
  • 2
  • 2
  • 7
4
votes
1 answer

Jenkins execute PowerShell scripts

I'm trying to run PowerShell scripts from Jenkins, but it seems to completely ignore the execution policy! This happens either by executing powershell.exe directly, or using the PowerShell plugin Additional information: Jenkins is running as a…
Igal Tabachnik
  • 30,180
  • 15
  • 86
  • 150
3
votes
1 answer

Is setting ExecutionPolicy to Unrestricted for CurrentUser a security breach?

I have a couple of aliases I like to have in my PowerShell on my Windows 10. I want them to persist between sessions, so I have put them in a profile.ps1 file under C:\Users{username}\Documents\WindowsPowerShell. I am getting this annoying "cannot…
hasse
  • 834
  • 1
  • 7
  • 21
3
votes
1 answer

Powershell script fails when run via nant

I have several team members who can't run powershell scripts via nant. When they do, they get the ExectutionPolicy (not high enough, still set at the default value). However, they've run Set-ExecutionPolicy RemoteSigned in a powershell console, and…
kelloti
  • 7,985
  • 4
  • 40
  • 76
2
votes
1 answer

Unable to Set Execution Policy for Gitlab CI/CD Pipeline

I have created an Amazon Alexa Skill and I have also added ask-cli support to it. When I was trying to deploy it using ask-cli an error came i.e. /bin/sh: 1: hooks/pre_deploy_hook.sh: Permission denied [Error]: Hook Scripts failed Then, I opened…
2
votes
2 answers

Execution Policy error when running powershell script from autohotkey

I have a simple autohotkey script !+l:: RunWait, PowerShell -NoExit -C "Import-Module D:\projects\changescreensaver\changescreensaver.psm1; Set-ScreenSaverTimeout 1;" But it won't let me load my ps profile or do the import-module and gives me an…
xdhmoore
  • 6,443
  • 6
  • 37
  • 71
2
votes
1 answer

How to configure ExecutionPolicy as "RemoteSigned" in Powershell 4.0 api

I need to configure ExecutionPolicy as 'RemoteSigned' at initial session state or somehow before execution of script. I don't want to execute script to set policy. This would alter the policy at client machine which i don't want. In Powershell 5.0…
Usman
  • 2,426
  • 4
  • 36
  • 68
2
votes
2 answers

How to make PowerShell prompt for un-signed scripts

The execution policy in my environment is AllSigned: PS E:\Temp> Get-ExecutionPolicy AllSigned When I try to execute a not trusted script it throws the error: & : File C:\temp\anz.ps1 cannot be loaded. The file C:\temp\any.ps1 is not digitally…
Jay Joshi
  • 984
  • 8
  • 17
2
votes
1 answer

Roslyn Setup - Powershell Scripts

I've been trying to install the Rosyln source code from Github and following the build setup instructions. The first instruction is to run Restore.cmd - which produces the following error message: File C:\Code\roslyn-master\build\scripts\build.ps1…
Spodgy
  • 192
  • 3
  • 12
1
2 3 4