Diskpart for Windows

Hello,
I am working on deploying some Server 2016 machines with an awx playbook. I am adding a data volume but I am noticing that server 2016 is not formatting the disk like Server 2012 does. With 2012 all I need to do is reboot.

Is there a way to run the diskpart commands within a playbook to get the drive formatted?

Thanks in advance!

Josh

Hi

If you want to use diskpart I believe you need to put each command as a line in a text file and then call the diskpart exe and reference that text file. This isn’t really ideal and you should probably look at the newer PowerShell cmdlets to do what you want. I found this is a good place to start when looking at them https://blogs.msdn.microsoft.com/san/2012/07/03/managing-storage-with-windows-powershell-on-windows-server-2012/, unfortunately we don’t have any modules to do this work yet so you will have to use some sort of script right now.

Thanks

Jordan

Thanks Jordan. This post solved my issue. I was able to list the commands and pull the dive and format it with a simple power shell script.