Working with Path Names

by Aug 6, 2010

The .NET System.IO.Path class has a number of very useful static methods that you can use to extract file extensions. Here is how you can get a list of available methods:

[System.IO.Path] | Get-Member -Static

And here is an example on how to use one of the listed methods:

[System.IO.Path]::ChangeExtension("test.txt", "ps1")

Twitter This Tip! ReTweet this Tip!