Created
August 13, 2018 23:48
-
-
Save vermashi/c9080c6549cf3f36d14e034703ec9521 to your computer and use it in GitHub Desktop.
Format all uninitialized disks with an MBR partition table and an NTFS partition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sizeInBytes = (((16 * 1024) * 1024) * 1024) - 1 | |
Get-Disk | Where-Object PartitionStyle -eq "RAW" | Where-Object Size -gt $sizeInBytes | Initialize-Disk -PartitionStyle MBR -Confirm:$False -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -Confirm:$False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment