By converting a path to a FileInfo object, you can easily determine the path parent folder or file extension. Have a look:

([IO.FileInfo]'c:\test\abc.ps1').Extension 

([IO.FileInfo]'c:\test\abc.ps1').DirectoryName

Twitter This Tip! ReTweet this Tip!

Anonymous