User Tools

Site Tools


computing:how_to_setup_powershell

How to setup PowerShell

Useful commands

See Current PowerShell Script Execution Policies

Get-ExecutionPolicy -List

Set PowerShell script execution policy for current user in PowerShell

Set-ExecutionPolicy AllSigned -Scope CurrentUser -Force

Set-ExecutionPolicy Bypass -Scope CurrentUser -Force

Set-ExecutionPolicy Default -Scope CurrentUser -Force

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

Set-ExecutionPolicy Restricted -Scope CurrentUser -Force

Set-ExecutionPolicy Undefined -Scope CurrentUser -Force

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

Set PowerShell script execution policy for local machine in PowerShell

Requires elevated privileges

Set-ExecutionPolicy AllSigned -Scope LocalMachine -Force

Set-ExecutionPolicy Bypass -Scope LocalMachine -Force

Set-ExecutionPolicy Default -Scope LocalMachine -Force

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -Force

Set-ExecutionPolicy Restricted -Scope LocalMachine -Force

Set-ExecutionPolicy Undefined -Scope LocalMachine -Force

Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force

Install Chocolately

Requires elevated privileges

Set-ExecutionPolicy Bypass -Scope Process
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Information

Profiles

Description Path
All Users, All Hosts $PSHOME\Profile.ps1
All Users, Current Host $PSHOME\Microsoft.PowerShell_profile.ps1
Current User, All Hosts $Home\[My ]Documents\PowerShell\Profile.ps1
Current user, Current Host $Home\[My ]Documents\PowerShell\Microsoft.PowerShell_profile.ps1

$PSHOME is usually C:\Windows\System32\WindowsPowerShell\v1.0

computing/how_to_setup_powershell.txt · Last modified: 2020-12-29T18:32:28+0000 (external edit)