win_disk_facts - Set output array order to be by disk number property (#64997)

* win_disk_facts - Set output array order to be by disk number property - https://github.com/ansible/ansible/issues/63998

* Update win_disk_facts.ps1
This commit is contained in:
Shachaf92 2019-12-01 22:54:18 +02:00 committed by Jordan Borean
parent d8982b4992
commit 03dce68227
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- "win_disk_facts - Set output array order to be by disk number property - https://github.com/ansible/ansible/issues/63998"

View file

@ -244,5 +244,8 @@ foreach ($disk in $disks) {
$result.ansible_facts.ansible_disks += $disk_info $result.ansible_facts.ansible_disks += $disk_info
} }
# Sort by disk number property
$result.ansible_facts.ansible_disks = @() + ($result.ansible_facts.ansible_disks | Sort-Object -Property {$_.Number})
# Return result # Return result
Exit-Json -obj $result Exit-Json -obj $result