Add new session parameter to win_psexec (#44263)

* Add new session parameter to win_psexec

* Indicate which version the session option was added in

* Added changelog fragment and minor edit on doc entry
This commit is contained in:
Xyon 2018-08-29 00:42:59 +01:00 committed by Jordan Borean
parent 2bd0a66c08
commit 03261b3053
3 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- win_psexec - Added the ``session`` option to specify a session to start the process in

View file

@ -24,6 +24,7 @@ $elevated = Get-AnsibleParam -obj $params -name "elevated" -type "bool" -default
$limited = Get-AnsibleParam -obj $params -name "limited" -type "bool" -default $false $limited = Get-AnsibleParam -obj $params -name "limited" -type "bool" -default $false
$system = Get-AnsibleParam -obj $params -name "system" -type "bool" -default $false $system = Get-AnsibleParam -obj $params -name "system" -type "bool" -default $false
$interactive = Get-AnsibleParam -obj $params -name "interactive" -type "bool" -default $false $interactive = Get-AnsibleParam -obj $params -name "interactive" -type "bool" -default $false
$session = Get-AnsibleParam -obj $params -name "session" -type "int"
$priority = Get-AnsibleParam -obj $params -name "priority" -type "str" -validateset "background","low","belownormal","abovenormal","high","realtime" $priority = Get-AnsibleParam -obj $params -name "priority" -type "str" -validateset "background","low","belownormal","abovenormal","high","realtime"
$timeout = Get-AnsibleParam -obj $params -name "timeout" -type "int" $timeout = Get-AnsibleParam -obj $params -name "timeout" -type "int"
$extra_opts = Get-AnsibleParam -obj $params -name "extra_opts" -type "list" $extra_opts = Get-AnsibleParam -obj $params -name "extra_opts" -type "list"
@ -83,6 +84,9 @@ If ($system -eq $true) {
If ($interactive -eq $true) { If ($interactive -eq $true) {
$arguments += "-i" $arguments += "-i"
If ($session -ne $null) {
$arguments += $session
}
} }
If ($limited -eq $true) { If ($limited -eq $true) {

View file

@ -65,6 +65,13 @@ options:
- Run the program so that it interacts with the desktop on the remote system. - Run the program so that it interacts with the desktop on the remote system.
type: bool type: bool
default: 'no' default: 'no'
session:
description:
- Specifies the session ID to use.
- This parameter works in conjunction with I(interactive).
- It has no effect when I(interactive) is set to C(no).
type: int
version_added: '2.7'
limited: limited:
description: description:
- Run the command as limited user (strips the Administrators group and allows only privileges assigned to the Users group). - Run the command as limited user (strips the Administrators group and allows only privileges assigned to the Users group).