Using Advanced Path Functions

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

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 PowerShell.com. All rights reserved.