Powershell

Create Bootable USB From ISO using Powershell

What's New In Hyper-V 2019

Creating a bootable USB installer for windows could get very tricky sometimes, especially when you do not have internet access to download any software to create bootable media. Luckily Powershell is always available in most recent versions of windows, and it can get the job done without installing any additional software on your computer.

Requirements for Creating Windows Bootable USB

  • Mining 8GB of USB Flash Drive
  • Latest Version of Windows ISO File
  • Any version of Windows with Powershell 4 or above

Preparing USB

Once you met all the requirements mentioned above, its time to plug the USB flash drive into your computer and run the following command to get the drive number and other information related to the Flash drive.

            Get-Disk | Where BusType -eq 'USB'
        

Next, we will clear the USB Flash drive by running the following command.

            Clear-Disk -Number 3 -RemoveData -Confirm:$false -PassThru
        

Formatting USB Flash Drive

Once the USB is cleared, our next step will be creating a partition and formatting it with the NTFS file system by executing the below command in Powershell console.

            New-Partition -DiskNumber 3 -UseMaximumSize -AssignDriveLetter | Format-Volume -FileSystem NTFS
        

Mounting The Windows ISO File

After formatting the USB Flash drive with the NTFS file system, our next step will be mounting the Windows ISO file by running the following command.

            Mount-DiskImage -ImagePath "c:\win10.iso"
        

Next, We will find out the drive letter assigned to our Windows ISO file by running the following command.

            Get-CimInstance Win32_LogicalDisk | ?{ $_.DriveType -eq 5} | select DeviceID
        

Coping Data From ISO To USB

Next, we run the xcopy command to copy everything from the mounted ISO file to Our USB drive.

            xcopy G:\ E:\ /e
        

The copying process is started, and it will take some time to copy all the files to our USB flash drive, so sit back and relax.

Once all the files get copied to our flash drive, you can remove the now bootable USB flash drive and plug it where you want the Operating system to be installed and boot from the newly created bootable USB flash drive.

If you want to create a bootable flash drive using software instead of Powershell please have a look at the below article.

How To Create A Bootable USB Installation Media For Windows Server 2019

Muhammad Faizan

Hi, My name is Muhammad Faizan and i have spent last 15 years working as System Administrator mainly with Microsoft Technologies. I am MCSE, MCTP, MCITP, certified professional. I love scripting and Powershell is the scripting language i am in love with.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button