Skip to content

Commit

Permalink
Add Execution Policy setting to Powershell based shell plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
herronelou authored and maxnbk committed Sep 6, 2023
1 parent 6962573 commit cab9ec3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rezplugins/shell/_utils/powershell_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ def _record_shell(ex, files, bind_rez=True, print_msg=False):
# Suppresses copyright message of PowerShell and pwsh
cmd += ["-NoLogo"]

# Powershell execution policy overrides
execution_policy = self.settings.execution_policy
if execution_policy:
cmd += ["-ExecutionPolicy", execution_policy]

# Generic form of sourcing that works in powershell and pwsh
cmd += ["-File", target_file]

Expand Down
2 changes: 2 additions & 0 deletions src/rezplugins/shell/rezconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ powershell:
prompt: '> $ '
additional_pathext: ['.PY']
executable_fullpath: null
execution_policy: null

pwsh:
prompt: '> $ '
additional_pathext: ['.PY']
executable_fullpath: null
execution_policy: null

gitbash:
prompt: '>'
Expand Down

0 comments on commit cab9ec3

Please sign in to comment.