Avatar of Mike
Mike
Flag for United States of America asked on

Need help setting up a Powershell script

I need to help creating a power shell script to /delete (i.e. bcdedit /delete {current}) the current bcd definition and restart the computer.. can somebody help me with this.....
PowershellVB ScriptScripting Languages

Avatar of undefined
Last Comment
Mike

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
David Johnson, CD

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Bill Prew

And of course in a simple BAT script it could be as follows.  Both the bcdedit and shutdown command have other options that you might need/want to explore.  I also believe this needs to be run in elevated privs.

bcdedit /delete {current}
shutdown /r

Open in new window



»bp
Mike

ASKER
Thanks, David  - You got me in the right direction ... Still Learning PowerShell....    string I using below  



start-process "C:\Windows\system32\bcdedit.exe"  -Argumentlist "/delete {current}"

Your help has saved me hundreds of hours of internet surfing.
fblack61