We help IT Professionals succeed at work.

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.....
Comment
Watch Question

Distinguished Expert 2019
Commented:
start-process bcdedit -arguments /delete {current}
restart-computer
Bill PrewTest your restores, not your backups...
Expert of the Year 2019
Top Expert 2016

Commented:
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
MikeSecurity

Author

Commented:
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}"