a
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
- name: Find Recovery partitions (PowerShell → JSON)
|
||||
ansible.windows.win_powershell:
|
||||
script: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$guid = '{DE94BBA4-06D1-4D40-A16A-BFD50179D6AC}'
|
||||
$parts = @( Get-Partition |
|
||||
Where-Object { $_.GptType -eq $guid -or $_.Type -eq 'Recovery' -or $_.Type -eq 'Unknown' } |
|
||||
@@ -36,12 +37,9 @@
|
||||
|
||||
- name: Parse JSON to a list
|
||||
ansible.builtin.set_fact:
|
||||
winre_parts: >-
|
||||
{{ (winre_raw.output | join('') | trim) | default('[]') | from_json }}
|
||||
winre_parts: "{{ (winre_raw.output | join('') | trim | default('[]')) | from_json }}"
|
||||
|
||||
- name: Show Recovery partition sizes
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
Disk {{ item.DiskNumber }}, Partition {{ item.PartitionNumber }},
|
||||
Size: {{ item.SizeMB }} MB ({{ item.SizeBytes }} bytes)
|
||||
msg: "Disk {{ item.DiskNumber }}, Part {{ item.PartitionNumber }}, Size: {{ item.SizeMB }} MB ({{ item.SizeBytes }} bytes)"
|
||||
loop: "{{ winre_parts }}"
|
||||
Reference in New Issue
Block a user