Test to see if the Drives exist

Hello,
I am new to Ansible and looking for some assistance. I want to be able to run the Ansible script for changes and or additions without rebuilding the server. In my Ansible script I am using the below snippet to configure the 2 additional drives that I have added to the server. Any suggestions on how to test first that the drives exist with the correct labels, drive letters, and partition styles so Ansible will not run that portion again if it is already configured?

`

- name: Partition and format drive1
  win_shell: Get-Disk | Where number -eq '1' | Initialize-Disk -PartitionStyle GPT -PassThru | New-Partition -UseMaximumSize -DriveLetter E | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Data" -Confirm:$false

- name: Partition and format drive2
  win_shell: Get-Disk | Where number -eq '2' | Initialize-Disk -PartitionStyle GPT -PassThru | New-Partition -UseMaximumSize -DriveLetter F | Format-Volume -FileSystem NTFS -NewFileSystemLabel "DocVault" -Confirm:$false

`


TIA!

Any suggestions?
TIA!

Since this a Ansible list and not how do I do something in Windows list you might have better luck in a Windows list/forum/community.

This is an Ansible issue/request, hence why I am on this forum asking for help.

You asked for a suggestion and I gave you one, up to you if you take the advise or not.

The reality is that you haven't gotten a reply and asking about which Windows/power shell commands(aka not Ansible) you can run to find label, drive letter and partition.

That's why I suggested you might have better luck in a Windows list/forum/community that actually knows this stuff.

I was able to figure this out, for those of you that want to make sure adding a drive is idempotent. See below:

`

- name: Check to see if the E drive already exists
  win_stat:
    path: E:\
  register: EdriveExists

`