Hello Team,
I am working on the automation task with the help of BigFix and backend automation tool where I need to get RAW partition Disk details, then initialize and clean it after that partition creation. Backend automation team only knows the size of the Disk and know what letter need to assign against the size, but they don’t know about Disk Number which is mandatory part to create Partition. I am able to get both the details Disk Number and Disk Size which is correspondent to each other with below command.
Get-Disk | where-object {($.PartitionStyle -contains “RAW”)} | Select-Object {$.Size /1GB},{$_.Number} | ft -HideTableHeaders
80 0
10 3
11 4
12 5
13 6
13 7
Below is the command to create partition. Here you can see DiskNumber we need to enter for New Partition.
New-Partition -DiskNumber 3 -UseMaximumSize -DriveLetter A | Format-Volume -FileSystem NTFS
I am completely stuck here and dont know what to do next to meet the goal. Any mapping can we do in above table so that if automation tool enter the size “13” then it should check in above table and put Disk Number 7 in the Partition command and if they enter size “10” then it should put “3” in Partition command.
I hope i am clear engough to explain the issue and help needed. Kindly help