-
Notifications
You must be signed in to change notification settings - Fork 167
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: Cannot run script containing Powershell 7 operators #452
Comments
The problem here is ansible.windows/plugins/modules/win_powershell.ps1 Lines 517 to 528 in 553185b
[CmdletBinding(SupportsShouldProcess)] is set as this is used to check whether to run this in check mode with -WhatIf . What we can probably do is catch the parse error and do a more rudimentary check for this attribute and add a documentation caveat around it.
|
Awesome - thank you for looking into this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
When attempting to utilize powershell 7 operators with win_powershell module, it appears the module fails due to a parsing error (since the "parent" process runs in PS 5).
ISSUE TYPE
COMPONENT NAME
win_powershell
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 18 (Controller)
Windows Server 2019 (with Powershell 7.2.7 installed)
STEPS TO REPRODUCE
EXPECTED RESULTS
win_powershell can run powershell 7 features when paramater executable is set to pwsh.exe
In the example above, I would assume "output" would have ""
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: