1

I know my volume has this path, and it's inside Disk number 3:

\\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}\

How do I get the actual Volume object using the Path to locate it?

I have tried with

Get-Volume -Path '\\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}\'

but it returns null. BTW, the partition related to the volume isn't formatted yet. I want to get access to the volume in order to use Format-Volume with it.


EDIT

I've run these commands on the disk and I correctly get the partitions. However, I'm unable to get the volumes of some partitions as you can see below.

enter image description here

enter image description here

SuperJMN
  • 13,110
  • 16
  • 86
  • 185

1 Answers1

0

If you want to take the DeviceID and work backwards, you need to look at :

$vol = Get-CimInstance -ClassName Win32_Volume -Filter 'DeviceID="\\\\?\\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e6963}\\"'

Note: I don't have an unformatted volume on a Win10 device, so you'll need to figure out which parameter set corresponds to your use-case for Get-Volume based on the properties of $vol.

Maximilian Burszley
  • 18,243
  • 4
  • 34
  • 63
  • I'm getting "invalid query" :( – SuperJMN Mar 18 '19 at 12:09
  • It's saying the same. I'm afraid it's unable to get volume – SuperJMN Mar 18 '19 at 12:52
  • Same. I'm getting $null. Please, check my updated question. I've posted some interesting snapshots. – SuperJMN Mar 18 '19 at 12:57
  • OK, I've used diskpart and discovered that there is no volume associated to the partition! how do I assign one? – SuperJMN Mar 18 '19 at 13:01
  • @SuperJMN That's kind of outside the scope of your existing question. You'd probably need to create one. I'd start with looking up documentation for `New-Volume` and if you get stuck, ask a new question after trying some things. – Maximilian Burszley Mar 18 '19 at 13:03
  • You're right! I've created the right question: https://stackoverflow.com/questions/55222465/how-to-format-a-partion-not-a-volume-using-powershell – SuperJMN Mar 18 '19 at 13:26