Create a bootable USB stick with PowerShell (Create-BootableUSBStick)
Creating a bootable USB stick could be a tricky task. You’ll need a tool (eg. the Windows 7 USB/DVD tool) or you have to struggle with those old cmd commands like bootsect.exe. This is now over, because I’ve created a PowerShell function for the community that automates all the steps you need for creating your Windows 10 or Windows Server bootable USB stick.
Create-BootableUSBStick in Action
I want to show you first what we are going to achieve.
Plug in your USB stick. Then mount the operating system iso file (Windows 7/8/10, Windows Server). Double check the drive letters. We’ll need them further on.
In my case the USB stick is associated with E: and the ISO is mounted on F:. The following command sets up an bootable Windows USB stick:
Now wait a few minutes and your USB stick is ready to use!
How to use it
Copy the code into your PowerShell ISE session and run the code. Then type the command and have fun with it.
If you want to make the function permanent available, so that the function is there every time you start PowerShell, you have to create a folder in C:\Program Files\WindowsPowerShell\Modules. Name it Create-BootableUSBStick. Then save the code as a .psm1 file in that folder. The screenshot below will be a great help.