mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
win_shell: Implement option 'profile', allowing the user to control p… (#54299)
* win_shell: Implement option 'profile', allowing the user to control powershell profile sourcing before running a command * Set version_added to 2.8 * Make sure profile directory exists before writing profile file * Changes to make tests immutable and align with ps args
This commit is contained in:
@@ -257,3 +257,31 @@
|
||||
- nonascii_output.stdout_lines|count == 1
|
||||
- nonascii_output.stdout_lines[0] == 'über den Fußgängerübergang gehen'
|
||||
- nonascii_output.stderr == ''
|
||||
|
||||
- name: execute powershell without no_profile
|
||||
win_shell: '[System.Environment]::CommandLine'
|
||||
register: no_profile
|
||||
|
||||
- name: assert execute powershell with no_profile
|
||||
assert:
|
||||
that:
|
||||
- no_profile is successful
|
||||
- no_profile is changed
|
||||
- no_profile.cmd == "[System.Environment]::CommandLine"
|
||||
- no_profile.rc == 0
|
||||
- no_profile.stdout is match ('^powershell.exe -noninteractive -encodedcommand')
|
||||
|
||||
- name: execute powershell with no_profile
|
||||
win_shell: '[System.Environment]::CommandLine'
|
||||
args:
|
||||
no_profile: yes
|
||||
register: no_profile
|
||||
|
||||
- name: assert execute powershell with no_profile
|
||||
assert:
|
||||
that:
|
||||
- no_profile is successful
|
||||
- no_profile is changed
|
||||
- no_profile.cmd == "[System.Environment]::CommandLine"
|
||||
- no_profile.rc == 0
|
||||
- no_profile.stdout is match ('^powershell.exe -noprofile -noninteractive -encodedcommand')
|
||||
|
||||
Reference in New Issue
Block a user