Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code Unsigned Powershell Scripts

I started using Visual Studio Code for Powershell scripting. I'd like to turn off the check for unsigned code, but cannot find out how to do this. I have not found anything in the forums either.

like image 925
Ryan Schoenhard Avatar asked Oct 30 '17 20:10

Ryan Schoenhard


People also ask

How do I run an unsigned PowerShell script?

Scenario/Problem: You need to be able to run unsigned scripts within PowerShell. Solution: Use the Set-ExecutionPolicy command. You are prompted with a confirmation. Enter Y and press Enter (or just press Enter— Y is the default).

How do I write a PowerShell script in Visual Studio code?

Click the create a launch. From the Select Environment prompt, choose PowerShell. Choose the type of debugging you'd like to use: Launch Current File - Launch and debug the file in the currently active editor window. Launch Script - Launch and debug the specified file or command.


1 Answers

I solved by setting the policy as :

Set-ExecutionPolicy –ExecutionPolicy RemoteSigned

to the Visual code integrated environment running as administrator.

The following blog clearly lists the steps to solve it:

http://donovanbrown.com/post/Using-PowerShell-in-VS-Code

like image 126
Enzo Avatar answered Sep 29 '22 14:09

Enzo