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