Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 1.0 » Split-Path

Split-Path - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Split-Path

Description
Return part of a path

Usage


Options


Example(s)
Display a list of .XLS filenames in the docs folder (don't return the whole path):

PS C:\>split-path "C:\Docs\*.xls" -leaf -resolve

Change directory to the folder containing the powershell profile:

PS C:\>Set-Location(split-path $profile -parent)

The above can be simplified with the 'cd' alias for set-location and relying on -parent being the default:

PS C:\>cd(split-path $profile)