Export (0) Print
Expand All
Expand Minimize

Converting the FileSystemObject's ParentFolder Property

Windows PowerShell

Definition: Returns a reference to the parent of the specified file or folder.


Use the -parent parameter of the Split-Path cmdlet to retrieve the parent of a file or folder:

Split-Path C:\scripts -parent

To retrieve a reference to that file or folder, pipe the output to Get-Item:

$a = Split-Path C:\scripts -parent | Get-Item

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
© 2015 Microsoft