You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用PowerShell在动态磁盘上查找EFI分区?

在动态磁盘上通过PowerShell查找EFI分区的方法

通常,使用PowerShell查找EFI分区的常规命令如下:

Get-Disk | where IsBoot | Get-Partition |
  where GptType -eq '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}'

但Get-Disk和Get-Partition均不支持动态磁盘,WMI/CIM也未提供便捷的EFI分区定位方法。请问是否存在无需借助bcdedit.exe或diskpart.exe,仅通过PowerShell在动态磁盘上查找EFI分区的方法?

我找到了以下相关资料,但仍有疑问:

  • 微软学习中心 - 启动配置数据WMI提供程序
  • 微软学习中心 - BCD WMI提供程序类
  • GitHub AzureDocs - 配置BCD设置的PowerShell/WMI示例
  • Michls技术博客 - 通过WIM访问BCD存储的基础知识
  • CodeProject - 使用PowerShell修改Windows BCD

遗憾的是,CodeProject上的示例缺少我所需的数据,而且由于我不了解BcdStore对象模型,不知道如何检索更多信息。

示例代码:

$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
    }
]

内容的提问来源于stack exchange,提问作者Dennis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.29 13:05:35