Episode 6 – Split-Path

Download the MP3 Podcast

In this episode we look at how you can carve up strings that make up strings of text that make up paths with Split-Path:

By default – returns parent path

Split-Path c:\users\tome
c:\user

Leaf – returns the end of the path (file or directory name)

Split-Path c:\users\tome -Leaf
tome

NoQualifier – removes the drive letter from the path

Split-path hklm:\software\microsoft -NoQualifier
\software\microsoft

Qualifier – returns just the drive letter

Split-path c:\users\tome
c:\

IsAbsolute – returns true if it is an absolute path, not a relative path.

Resolve – evaluates the string path to a real path

Brought to you by The Windows PowerShell Bible 2.0 and PowerShellGroup.Org

Advertisements

About Tome

Tome is a Windows engineer for a market-leading global financial services firm in New York City. He is the founder and leader of the New York City PowerShell User group, a blogger, a regular contributor to Microsoft's Windows PowerShell forum, and he has received the MVP award for Windows PowerShell from Microsoft. He is currently working on the PowerShell Bible, which is due out in June 2011 from Wiley.

Posted on September 5, 2011, in Core Cmdlets, Podcast, PowerShell. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: