Using Advanced Path Functions

Share |

Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Powershell Plus

13 Free SQL Tools from Idera

Free Ebook: Mastering Powershell


Whenever the built-in Split-Path cmdlet isn't enough, you can always resort to the real .NET class behind it. This class is called System.IO.Path, Use Get-Member with the -static parameter to list its members:

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

To actually use any of those, append "::" to the class. For example, here is how you can change the file extension of a path to ".ps1":

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

Posted Jun 12 2009, 08:00 AM by ps1
Copyright 2012 All rights reserved.