Using the GUI in Windows server, I can add a new partition once new disks are physically added. Here is how the process goes without PowerShell:
1) physically add a new disk to the server
I want to do steps 3 through 6 in PowerShell. How do I do this?
As long as you're using at least Server 2012, something like this should work:
Set-Disk -Number 1 -IsOffline $false -IsReadOnly $false Initialize-Disk -Number 1 -PartitionStyle GPT New-Partition -DiskNumber 1 -DriveLetter F -UseMaximumSize Format-Volume -DriveLetter F -FileSystem NTFS
That particular example is hard-coded to use disk number 1; instead, you might want to do something with Get-Disk, and filter for disks that are currently offline.
For older operating systems, you'll probably wind up using diskpart.exe.
You must be logged in to reply to this topic.