Does anyone know of a more concise way to find the short path for a file in PowerShell script? I currently have this expression:
(New-Object -ComObject Scripting.FileSystemObject).GetFile("S:\Program Files\Adobe\Adobe Photoshop Lightroom 3 Beta\lightroom.exe").ShortPath
…to get S:\PROGRA~1\Adobe\ADOBEP~1\LIGHTR~1.EXE
However, it seems like an absurdly complicated expression given what I want to do. I don’t do much with PowerShell, though, so I thought that someone else might have a better way. Any ideas? :h: