win_user_right - fix non json output issue (#54495)
This commit is contained in:
parent
b62ab97685
commit
e2d2874d81
3 changed files with 9 additions and 7 deletions
2
changelogs/fragments/win_user_right-output.yaml
Normal file
2
changelogs/fragments/win_user_right-output.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- win_user_right - Fix output containing non json data - https://github.com/ansible/ansible/issues/54413
|
|
@ -296,7 +296,8 @@ $lsa_helper = New-Object -TypeName Ansible.LsaRightHelper
|
|||
|
||||
$new_users = [System.Collections.ArrayList]@()
|
||||
foreach ($user in $users) {
|
||||
$new_users.Add((Convert-ToSID -account_name $user))
|
||||
$user_sid = Convert-ToSID -account_name $user
|
||||
$new_users.Add($user_sid) > $null
|
||||
}
|
||||
$new_users = [String[]]$new_users.ToArray()
|
||||
try {
|
||||
|
@ -321,7 +322,7 @@ if (($change_result.added.Length -gt 0) -or ($change_result.removed.Length -gt 0
|
|||
$user_name = Convert-FromSID -sid $user
|
||||
$result.removed += $user_name
|
||||
$diff_text += "-$user_name`n"
|
||||
$new_user_list.Remove($user)
|
||||
$new_user_list.Remove($user) > $null
|
||||
}
|
||||
foreach ($user in $change_result.added) {
|
||||
if (-not $check_mode) {
|
||||
|
@ -330,7 +331,7 @@ if (($change_result.added.Length -gt 0) -or ($change_result.removed.Length -gt 0
|
|||
$user_name = Convert-FromSID -sid $user
|
||||
$result.added += $user_name
|
||||
$diff_text += "+$user_name`n"
|
||||
$new_user_list.Add($user)
|
||||
$new_user_list.Add($user) > $null
|
||||
}
|
||||
|
||||
if ($diff_mode) {
|
||||
|
|
|
@ -153,7 +153,6 @@ lib/ansible/modules/windows/win_uri.ps1 PSAvoidUsingEmptyCatchBlock
|
|||
lib/ansible/modules/windows/win_user.ps1 PSAvoidTrailingWhitespace
|
||||
lib/ansible/modules/windows/win_user.ps1 PSAvoidUsingCmdletAliases
|
||||
lib/ansible/modules/windows/win_user_profile.ps1 PSCustomUseLiteralPath
|
||||
lib/ansible/modules/windows/win_user_right.ps1 PSAvoidTrailingWhitespace
|
||||
lib/ansible/modules/windows/win_wait_for.ps1 PSAvoidUsingEmptyCatchBlock
|
||||
lib/ansible/modules/windows/win_wait_for.ps1 PSCustomUseLiteralPath
|
||||
lib/ansible/modules/windows/win_webpicmd.ps1 PSAvoidUsingInvokeExpression
|
||||
|
|
Loading…
Reference in a new issue