Skip to content

Commit

Permalink
Ensure execution policy does not contain special chars
Browse files Browse the repository at this point in the history
Signed-off-by: Erwan Leroy <herronelou@gmail.com>
  • Loading branch information
herronelou committed Jan 28, 2024
1 parent f0b8f9d commit de017f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rezplugins/shell/_utils/powershell_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ def _record_shell(ex, files, bind_rez=True, print_msg=False):
cmd += ["-NoLogo"]

# Powershell execution policy overrides
# Prevent injections/mistakes by ensuring policy value only contains letters.
execution_policy = self.settings.execution_policy
if execution_policy:
if execution_policy and execution_policy.isalpha():
cmd += ["-ExecutionPolicy", execution_policy]

# Generic form of sourcing that works in powershell and pwsh
Expand Down

0 comments on commit de017f6

Please sign in to comment.