$DiskCount = (Get-Disk | Where-Object {$_.BusType -eq "USB"}).Number.Count
if ($DiskCount -eq 1) {
filter Get-FirstResolvedPath {
(Get-Disk |
Where-Object {$_.BusType -eq "USB"} |
Get-Partition |
Get-Volume |
Where-Object {$null -ne $_.DriveLetter}
).DriveLetter + ':\' | Join-Path -ChildPath $_ -Resolve -ErrorAction SilentlyContinue
}
'Folder\Folder\reg\Start.reg' | Get-FirstResolvedPath
}
Есть ли другой способ получить полный путь к файлу, если он хранится на USB-накопителе, абсолютный путь и мы не знаем буквы USB-диска?