Normally when looking for the EFI-partition using PowerShell you can use
Get-Disk | where IsBoot | Get-Partition |
where GptType -eq '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}'
However, neither Get-Disk or Get-Partition works with Dynamic Disks.
It seems that WMI/CIM doesn't provide any easy means of locating EFI-partitions.
Is there a way to find the EFI-partition on Dynamic Disks using PowerShell with out resorting to bcdedit.exe or diskpart.exe?
I did find these links, but really...
- MS Learn - Boot Configuration Data WMI Provider
- MS Learn - BCD WMI Provider Classes
- GitHub AzureDocs - PowerShell/WMI Example for configuring BCD settings
- Michls Tech Blog - Some basics accessing the BCDstore by WIM
- CodeProject - Modify Windows BCD using Powershell
Unfortunatly, this example from the CodeProject is missing data that I need.
And since I have no idea about the BcdStore object model, I don't know how to retrive additional imformation.
$mem = Get-StaticBcdStore | Open-Store "" |
Open-Object "{b2721d73-1db4-4c62-bf78-c548a880142d}"
$dev = $mem |
Get-Element -Type ([BcdLibraryElementTypes]::Device_ApplicationDevice) |
Get-Device
$dev.Properties_ | ConvertTo-Json -Depth 5
[
{
"Value": "",
"Name": "AdditionalOptions",
"IsLocal": true,
"Origin": "BcdDeviceData",
"CIMType": 8,
"Qualifiers_": [
{
}
],
"IsArray": false
},
{
"Value": 2,
"Name": "DeviceType",
"IsLocal": true,
"Origin": "BcdDeviceData",
"CIMType": 19,
"Qualifiers_": [
{
}
],
"IsArray": false
},
{
"Value": "\\Device\\HarddiskVolume2",
"Name": "Path",
"IsLocal": true,
"Origin": "BcdDevicePartitionData",
"CIMType": 8,
"Qualifiers_": [
{
}
],
"IsArray": false
}
]
Edit 1: Added example from CodeProject
try this way