mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Add try to the keywords list
This commit is contained in:
parent
aeecd6b7b2
commit
905f8c9826
2 changed files with 2 additions and 1 deletions
|
@ -293,7 +293,7 @@ def _prep_powershell_cmd(win_shell, cmd, encoded_cmd):
|
|||
|
||||
# Commands that are a specific keyword behave differently. They fail if
|
||||
# you add a "&" to the front. Add those here as we find them:
|
||||
keywords = ["$", "&", ".", "Configuration"]
|
||||
keywords = ["$", "&", ".", "Configuration", "try"]
|
||||
|
||||
for keyword in keywords:
|
||||
if cmd.startswith(keyword):
|
||||
|
|
|
@ -1064,6 +1064,7 @@ def test_prep_powershell_cmd_no_powershell():
|
|||
[
|
||||
("Write-Host foo", "& Write-Host foo"),
|
||||
("$PSVersionTable", "$PSVersionTable"),
|
||||
("try {this} catch {that}", "try {this} catch {that}"),
|
||||
],
|
||||
)
|
||||
def test_prep_powershell_cmd(cmd, parsed):
|
||||
|
|
Loading…
Add table
Reference in a new issue