Export (0) Print
Expand All
Expand Minimize

Converting the FileSystemObject's GetDriveName Method


Windows PowerShell


Definition: Given a path, returns the drive letter.

GetDriveName


Use the -qualifier parameter with the Split-Path cmdlet to return only the drive letter.


PS C:\scripts> Split-Path "C:\scripts\test.txt" -qualifier
C:


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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft