a
This commit is contained in:
@@ -32,14 +32,20 @@
|
||||
@{n='SizeBytes';e={$_.Size}},
|
||||
@{n='SizeMB';e={[math]::Round($_.Size/1MB,2)}},
|
||||
GptType, Type )
|
||||
$parts = @($parts)
|
||||
$parts | ConvertTo-Json -Compress -Depth 4
|
||||
register: winre_raw
|
||||
changed_when: false
|
||||
|
||||
- name: Parse JSON to a list
|
||||
- name: Parse JSON (string → object)
|
||||
ansible.builtin.set_fact:
|
||||
winre_parts: "{{ (winre_raw.output | join('') | trim | default('[]')) | from_json }}"
|
||||
|
||||
- name: Normalize to list
|
||||
ansible.builtin.set_fact:
|
||||
winre_parts: "{{ [winre_parts] }}"
|
||||
when: winre_parts is mapping
|
||||
|
||||
- name: Show Recovery partition sizes
|
||||
ansible.builtin.debug:
|
||||
msg: "Disk {{ item.DiskNumber }}, Part {{ item.PartitionNumber }}, Size: {{ item.SizeMB }} MB ({{ item.SizeBytes }} bytes)"
|
||||
|
||||
Reference in New Issue
Block a user