this script is to work on partiton and format the drive , using the below script
Get-Disk |
Where partitionstyle -eq ‘raw’
Initialize-Disk -PartitionStyle GPT -PassThru |
New-Partition -UseMaximumSize |
Format-Volume -FileSystem NTFS -AllocationUnitSize 65536 -NewFileSystemLabel “G1500_Mount01” -Confirm:$false
I need to get the filesystem labels as “G1500_Moun01”, “G1500_Mount02” …
Please do not post images of code as they are not helpful at all. Instead post the plain text formatted as code. This way we can copy and try your code just the way you did. The same for console outpuit or error messages.
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
My code example only shows how you would increment the value appended to a string, in this case what you would use for the label. You would need to use a loop to repeat all the steps minus the first line to format each volume.