TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting the FileSystemObject's ParentFolder Property


Windows PowerShell


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

ParentFolder


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

Show:
© 2016 Microsoft