Added the option to configure the Execution Policy on Powershell scripts.

This commit is contained in:
Homes32
2024-06-22 14:18:26 -05:00
parent 8a478617e8
commit 63e8f57e28
3 changed files with 35 additions and 15 deletions

View File

@@ -35,8 +35,8 @@ Author=Homes32
Level=5
Selected=False
Mandatory=False
Version=1.0.14.0
Date=2024-06-20
Version=1.1.0.0
Date=2024-06-22
[Variables]
%ProgramFolder%="PowerShell"
@@ -45,6 +45,7 @@ Date=2024-06-20
%SetupFile%="PowerShell_x86.zip"
%DownloadURLx86%=https://github.com/PowerShell/PowerShell/releases/download/v%ProgramVersion%/PowerShell-%ProgramVersion%-win-x86.zip
%DownloadURLx64%=https://github.com/PowerShell/PowerShell/releases/download/v%ProgramVersion%/PowerShell-%ProgramVersion%-win-x64.zip
%ConfigFile%="%TargetPrograms%\%ProgramFolder%\powershell.config.json"
[Process]
Echo,"Processing %ScriptTitle%..."
@@ -72,6 +73,9 @@ RegRead,HKLM,"Tmp_System\ControlSet001\Control\Session Manager\Environment","Pat
StrFormat,CTrim,%SysPath%,";",%SysPath%
RegWrite,HKLM,0x2,"Tmp_System\ControlSet001\Control\Session Manager\Environment","Path","%SysPath%;%PEPrograms%\%ProgramFolder%\;"
// Execution Policy
JSONWrite,%ConfigFile%,"Microsoft\.PowerShell:ExecutionPolicy",%cmb_ExecutionPolicy%
RegUnloadHives
///////////////////////////////////////////////////////////////////////////////////
@@ -134,13 +138,13 @@ DirDeleteEx,"%ProgramsCache%\%ProgramFolder%"
[SetDefaultOptions]
System,Cursor,Wait
WriteInterface,Value,%ScriptFile%,Interface,cb_RunFromRam,False
WriteInterface,Value,%ScriptFile%,Interface,cb_AlwaysDownload,False
WriteInterface,Value,%ScriptFile%,Interface,cb_DesktopShc,False
WriteInterface,Value,%ScriptFile%,Interface,cb_StartMenuShc,True
WriteInterface,Value,%ScriptFile%,Interface,cb_PinToTaskbar,False
WriteInterface,Value,%ScriptFile%,Interface,cb_PinToStartMenu,False
WriteInterface,Value,%ScriptFile%,Interface,txt_StartMenuFolder,"System Tools"
WriteInterface,Value,%ScriptFile%,Interface,txt_ShortcutName,"PowerShell"
WriteInterface,Value,%ScriptFile%,Interface,cmb_ExecutionPolicy,"RemoteSigned"
System,Cursor,Normal
[#ToggleAdvancedOptions#]
@@ -199,6 +203,9 @@ cb_PinToTaskbar="Pin to Taskbar",1,3,12,142,122,18,False
cb_PinToStartMenu="Pin to Start Menu",1,3,12,161,122,18,False
txt_StartMenuFolder="Start Menu folder:",1,0,12,201,119,21,"System Tools"
txt_ShortcutName="Shortcut Name:",1,0,12,243,119,21,PowerShell
bvl_Options=Options,1,12,150,90,197,184,8,Bold
lbl_ExecutionPolicy="Execution Policy",1,1,160,110,150,16,8,Normal
cmb_ExecutionPolicy=RemoteSigned,1,4,160,125,150,21,AllSigned,Bypass,RemoteSigned,Restricted,Unrestricted
[InterfaceEncoded]
Trash.ico=1150,1212