Last active
March 1, 2019 18:52
-
-
Save nirinium/3ba0685cd749af6869ec2dda54875ce4 to your computer and use it in GitHub Desktop.
standard sql drives
This file contains hidden or 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
<# | |
20gb E: SQLBinaries | |
20gb F: SystemDB | |
10gb G: TempDBData | |
10gb H: TempDBData2 | |
10gb I: TempDBData3 | |
10gb J: TempDBData4 | |
10gb K: TempDBLog | |
50gb L: SQLData | |
20gb M: SQLLog | |
10gb W: NonSQLData | |
Clear All Disks: | |
Get-Disk 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 | Clear-Disk -RemoveData | |
#> | |
$newdisk = @(Get-Disk | Where-Object partitionstyle -eq 'raw') | |
$Labels = @('SQLBinaries','SystemDB','TempDBData','TempDBData2','TempDBData3','TempDBData4','TempDBLog','SQLData','SQLLog','NonSQLData') | |
for($i = 0; $i -lt $newdisk.Count ; $i++) | |
{ | |
$disknum = $newdisk[$i].Number | |
$dl = get-Disk $disknum | | |
Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | |
Format-Volume -driveletter $dl.Driveletter -FileSystem NTFS -NewFileSystemLabel $Labels[$i] -Confirm:$false | |
} | |
Get-Volume | Where-Object FileSystem -eq 'NTFS' | Sort-Object DriveLetter | Out-GridView #Out-File drives.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment