Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell bcdedit.exe

$
0
0

Has anyone figured out how to take the normal bcdedit.exe /enum response and convert it to objects?  

In the example below....if you had created and an array of objects called $bcdedit then you can loop through them like this......

foreach($item in $bcdedit)

{

$guid = $item.identifier

$description = $item.description

if ($description -eq "Windows Recovery Environment")

{

Write-Host $guid

}

}

Example bcdedit.exe /enum.......

Firmware Boot Manager

---------------------
identifier              {fwbootmgr}
displayorder            {bootmgr}
timeout                 2

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
integrityservices       Enable
default                 {current}
resumeobject            {e5e59e71-7cc1-11e2-be8f-c8d71990f704}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {3bc67383-7cc6-11e2-be6d-b0056d61dc0e}
device                  ramdisk=[\Device\HarddiskVolume1]\Recovery\WindowsRE\Wi
nre.wim,{3bc67384-7cc6-11e2-be6d-b0056d61dc0e}
path                    \windows\system32\winload.efi
description             Windows Recovery Environment
locale                  en-us
inherit                 {bootloadersettings}
displaymessage          Recovery
displaymessageoverride  Recovery
osdevice                ramdisk=[\Device\HarddiskVolume1]\Recovery\WindowsRE\Wi
nre.wim,{3bc67384-7cc6-11e2-be6d-b0056d61dc0e}
systemroot              \windows
nx                      OptIn
bootmenupolicy          Standard
winpe                   Yes


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>