- ThioJoe Video: https://www.youtube.com/watch?v=zW69MisrsWk
- Policy Plus: https://github.com/Fleex255/PolicyPlus
- PowerShell 7: https://github.com/PowerShell/PowerShell
- Open Start Menu
- Search for "Turn Windows Features on or off"
- Uncheck "Windows Powershell 2.0"
- Open Powershell Window
- Get Language Mode:
$ExecutionContext.SessionState.LanguageMode - Default is "FullLanguage"
- Open Start Menu
- Search for "Environment Variables"
- Select "Edit the system environment variables"
- Select "Environment Variables"
- Add NEW System Variable
- Variable Name:
__PSLockDownPolicy - Value:
4
- Variable Name:
- Open new Powershell Window
- Get Language Mode:
$ExecutionContext.SessionState.LanguageMode - Now should be "ConstrainedLanguage"
- Use included Group Policy Editor
- From Admin Terminal/CmdPrompt use:
gpedit.msc
- Use Policy Plus (link above)
- After installing, select "computer" in the drop down
- Navigate to: Computer Configuration / Administrative Templates / Windows Components / Windows Powershell
- Open Setting "Turn on Script Execution"
- Set to "Disabled"
- In Policy Plus, select Save in menu
- check Setting
- in a new Powershell Window, run
Get-ExecutionPolicy -List - should show "MachinePolicy" as Restricted
- in a new Powershell Window, run
- Download latest Powershell 7.0 "PowerShell-7.x.x-win-x64.zip" file (link above)
- Extract zip file into folder
- copy PowerShellCoreExecutionPolicy.admx into
c:\Windows\PolicyDefinitions - copy PowerShellCoreExecutionPolicy.adml into
c:\Windows\PolicyDefinitions\en-US
- Navigate to: Computer Configuration / Administrative Templates / PowerShell Core
- Open Setting "Turn on Script Execution"
- Set to "Disabled"
Get-ExecutionPolicy -ListSet-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process