$bootEntries = bcdedit /enum all | Select-String "description" -Context 1,0 foreach ($bootEntry in $bootEntries) { if ($bootEntry -clike '*IP4*' -or $bootEntry -clike '*IPv4*') { $boot = $bootEntry.ToString().Split('{') $GUID = $boot[1].Split('}')[0] bcdedit /set "{fwbootmgr}" displayorder "{$GUID}" "{bootmgr}" break } }