Converting the FileSystemObject's DriveLetter Property


Windows PowerShell


Definition: Returns the drive letter of the specified drive.

DriveLetter


See Drive. In PowerShell you use the same commands whether you’re returning a drive letter from a file, folder, or drive.


PS C:\scripts> Split-Path "C:\scripts " -qualifier
C:


Or, with the folder reference:


(Get-Item c:\scripts).fullname | Split-Path -qualifier


See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page

Show: