Skip to content

Instantly share code, notes, and snippets.

@luchosrock
Created June 10, 2015 15:28
Show Gist options
  • Save luchosrock/f05bf7d7d87624277696 to your computer and use it in GitHub Desktop.
Save luchosrock/f05bf7d7d87624277696 to your computer and use it in GitHub Desktop.
How to enable execution of user defined powershell scripts
#Create file with instructions and save as script.ps1
Write-Host "Hello, World!"
# Open cmder or CMD as Administrator (right button click > Open as administrator)
λ powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. Reservados todos los derechos.
PS> Set-ExecutionPolicy RemoteSigned
#Close program
#Open a new instance of powershell (same as before) and navigate to the script.ps1 folder
PS> & ".\script.ps1"
Hello, World!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment