Powershell to Create Bootable Disc
In the old times, we struggle to create a bootable USB drive
To create a bootable USB drive to install an operating system, you have to download the Windows 7 USB tool, or you had to mount the ISO (ISO MAGIC or ISO MOUNT) file with a non-Microsoft tool, copy the install bits, and then run a series of DiskPart commands.
Now, a bootable USB is easily created without needing DiskPart.exe or a non-Microsoft tool to mount the ISO file. Windows 8 has the ability to mount an ISO or VHD by simply double-clicking the file.
Following steps you have to follow.
1. Select or Get Disk
This is needed to get the disk number of the USB
Open your PC's PowerShell or Command Promt with administrative rights.
After inserting your USB pendrive, run DISKPART from the PowerShell.
Type the command LIST DISK. The result will be as shown below:
Here DISK 0 is the hard disk and DISK 1 is the pendrive I have used. (it depends on how many drive in your system, in my case it is only one drive thats why it is showing DISK 0 and DISK 1) SELECT DISK 1 2. Clear-Disk –Number 1
CREATE PARTITION PRIMARY
SELECT PARTITION 1
FORMAT FS=NTFS QUICK
And at finally, enter EXIT command 3. Insert your Windows 7 installation disk. Now open 'My Computer'. 4. Again start PowerShell and enter following commands one by one: bootsect.exe /NT60 F: according to my drives F is pendrive. 5. The last step is to copy all the contents of your Windows 7 installation disk to your pendrive. So open My Computer > Windows 7 installation CD and copy all the contents there and paste it in the USB drive you have used in this process.
Now your pendrive is ready to boot and you can install Windows 7 from that USB pendrive.