Access Volume via UID in PowerShell

0

I do have a Server with plenty of volumes where some are mounted in different directories and others have drive letters. I´m looking for a way to run something like this in Powershell

foreach ($element in (Get-Volume).Path) {

Get-childitem -path $element -File}

but i haven´t found a way that -path is accepting the volume UID

toprock

Posted 2017-08-29T12:18:25.727

Reputation: 55

Answers

1

Try changing the -Path parameter to -LiteralPath:

 Get-ChildItem -LiteralPath '\\?\Volume{45908b94-0000-0000-0000-100000000000}\'

This works for me.

WeatherForecastingRat

Posted 2017-08-29T12:18:25.727

Reputation: 173

0

No luck with this either, but:

Cmd.exe will accept the GUID in a dir command provided the trailing backslash is doubled.

C:\> dir \\?\Volume{26a449ef-cba1-4ed4-8b68-0958ea44d71d}\\

Explorer will also show the volume when using

PS> start "\\?\Volume{53663bce-0000-0000-0000-30b51000000}\"

Some links on the issue
Google search
Volume GUIDs – Ways To View/Access The Files Within
Access to a disk drive using volume ID

LotPings

Posted 2017-08-29T12:18:25.727

Reputation: 6 150

I know that post already but I don't want to start an explorer but want to work with the ps output in some CSV export. – toprock – 2017-08-29T14:49:16.773