mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 15:00:09 +00:00
Up the execution policy for default PWSH sessions
This is required to run the diagnostics script, and any script that either we create here, or the user creates later. At least we don't go too wild and use unrestricted... we use something more "safe"
This commit is contained in:
@@ -208,6 +208,13 @@ public class PowerManagement {
|
||||
reg add "HKLM\zSOFTWARE\WinUtil" /f
|
||||
reg add "HKLM\zSOFTWARE\WinUtil" /f /v "ToolboxVersion" /t REG_SZ /d "$($sync.version)"
|
||||
reg add "HKLM\zSOFTWARE\WinUtil" /f /v "MicroWinBuildDate" /t REG_SZ /d "$((Get-Date).ToString('yyMMdd-HHmm'))"
|
||||
|
||||
# REAL software developers set execution policies to unrestricted but, because we're targeting
|
||||
# mainstream population, we have to lower the level of "riskiness" -- set remotesigned; at least that
|
||||
# lets us run PWSH scripts that WE create. Execution policies don't really make sense anyway if common sense
|
||||
# is lacking.
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
|
||||
|
||||
reg unload HKLM\zSOFTWARE
|
||||
|
||||
if ($importVirtIO) {
|
||||
|
||||
Reference in New Issue
Block a user