-
Notifications
You must be signed in to change notification settings - Fork 173
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
Update win_command and win_shell add output_encoding_override
example
#658
Conversation
Add `output_encoding_override` examples to clarify the manual
Add `output_encoding_override` examples to clarify the manual
plugins/modules/win_shell.py
Outdated
@@ -115,6 +115,11 @@ | |||
ansible.windows.win_shell: C:\somescript.ps1 | |||
args: | |||
no_profile: true | |||
|
|||
- name: Run a PowerShell script with big5 encoding (fixing garbled text issue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure there is really a need to document this for win_shell
. PowerShell will be using the existing console encoding which we set to utf-8
. Any executable that the .ps1
script will call is subject to the encoding rules of PowerShell itself and shouldn't affect the output_encoding_override
unless the script itself changes the [Console]::OutputEncoding
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a user for Taiwan, using Traditional Chinese.
Tested using RHEL 9.4 as control nodes and Windows 2012 R2 as managed nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing, I think this is the case because keytool will be writing directly to the console and not going through PowerShell's string encoding. Appreciate you sharing this use case as I wasn't aware that would have been a problem.
Co-authored-by: Jordan Borean <jborean93@gmail.com>
unified descriptions
SUMMARY
Update
win_command.py
andwin_shell.py
addoutput_encoding_override
exampleI'm fixing ansible output encoding issue recently. During google search and ai answers which is not accurate.
Adding some example and trying to complete manual.
ISSUE TYPE
COMPONENT NAME
ansible.windows.win_command
moduleansible.windows.win_shell
moduleADDITIONAL INFORMATION
Some related issue
ansible/ansible#54896
ansible/ansible#54966