Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_powershell - support scripts with 7 syntax #459

Merged
merged 1 commit into from
Dec 18, 2022

Conversation

jborean93
Copy link
Collaborator

SUMMARY

It is possible to use PowerShell 7 scripts with this module when executable: pwsh.exe is used. This means the scriptblock parser that is being used will fail in Windows PowerShell when encountering syntax added in 7. This adds a fallback to using a regex match to check if the script also contains SupportsShouldProcess.

Fixes: #452

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

win_powershell

@jborean93 jborean93 merged commit 62b6c9c into ansible-collections:main Dec 18, 2022
@jborean93 jborean93 deleted the powershell-pwsh7 branch December 18, 2022 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win_powershell: Cannot run script containing Powershell 7 operators
1 participant