diff --git a/src/playbook/Configuration/tweaks/qol/config-powershell.yml b/src/playbook/Configuration/tweaks/qol/config-powershell.yml index a7a9e42cbe..d96ba31862 100644 --- a/src/playbook/Configuration/tweaks/qol/config-powershell.yml +++ b/src/playbook/Configuration/tweaks/qol/config-powershell.yml @@ -8,16 +8,8 @@ actions: # Set .ps1 file types to open with PowerShell by default # Batch scripts are not restricted and this measure can easily be bypassed by calling PowerShell within a batch script - !cmd: {command: 'ftype Microsoft.PowerShellScript.1="%windir%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -EP Unrestricted -File "%1" %*'} - - !registryValue: - path: 'HKCR\Applications\powershell.exe\shell\open\command' - value: '' - data: '"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -EP Unrestricted -File "%1" %*' - type: REG_SZ - - !registryValue: - path: 'HKCR\ps1_auto_file\shell\open\command' - value: '' - data: '"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -EP Unrestricted -File "%1" %*' - type: REG_SZ + - !cmd: {command: 'reg add "HKCR\Applications\powershell.exe\shell\open\command" /v "" /t REG_SZ /d "\"%windir%\System32\WindowsPowerShell\v1.0\powershell.exe\" -NoLogo -EP Unrestricted -File \"%1\" %*"'} + - !cmd: {command: 'reg add "HKCR\ps1_auto_file\shell\open\command" /v "" /t REG_SZ /d "\"%windir%\System32\WindowsPowerShell\v1.0\powershell.exe\" -NoLogo -EP Unrestricted -File \"%1\" %*"'} - !registryValue: path: 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ps1\OpenWithList' value: 'a' @@ -41,10 +33,6 @@ actions: # Set PowerShell execution policy to Unrestricted # Batch scripts are not restricted and this measure can easily be bypassed by calling PowerShell within a batch script - - !registryValue: - path: 'HKCU\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' - value: 'ExecutionPolicy' - operation: delete - !registryValue: path: 'HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' value: 'ExecutionPolicy' diff --git a/src/playbook/Executables/FILEASSOC.cmd b/src/playbook/Executables/FILEASSOC.cmd index b2ed15d9f0..2233ec83c6 100644 --- a/src/playbook/Executables/FILEASSOC.cmd +++ b/src/playbook/Executables/FILEASSOC.cmd @@ -55,7 +55,7 @@ exit /b :7ZIPUSER ( - reg add "HKCU\Software\7-Zip\Options" /v "ContextMenu" /t REG_DWORD /d "1073742374" /f + reg add "HKU\%~1\Software\7-Zip\Options" /v "ContextMenu" /t REG_DWORD /d "1073742374" /f reg add "HKU\%~1\Software\Classes\.001" /ve /t REG_SZ /d "7-Zip.001" /f reg add "HKU\%~1\Software\Classes\.7z" /ve /t REG_SZ /d "7-Zip.7z" /f reg add "HKU\%~1\Software\Classes\.apfs" /ve /t REG_SZ /d "7-Zip.apfs" /f