Combine() | Combines two strings with a provider specific path separator. |
CurrentFileSystemLocation | |
CurrentLocation | |
CurrentProviderLocation() | foreach ($p in get-psProvider){ "$p.name -> $($ExecutionContext.SessionState.Path.CurrentProviderLocation($p.name))" } |
GetResolvedProviderPathFromProviderPath() | Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more provider-internal paths. |
GetResolvedProviderPathFromPSPath() | Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more provider-internal paths. |
GetResolvedPSPathFromPSPath() | Resolves a drive or provider qualified absolute or relative path that may contain wildcard characters into one or more absolute drive or provider qualified paths |
GetUnresolvedProviderPathFromPSPath() | Converts a drive or provider qualified absolute or relative path that may contain wildcard characters into one a provider-internal path still containing the wildcard characters. |
IsProviderQualified() | |
IsPSAbsolute() | |
IsValid() | |
LocationStack() | |
NormalizeRelativePath() | |
ParseChildName() | |
ParseParent() | |
PopLocation() | |
PushCurrentLocation() | |
SetDefaultLocationStack() | |
SetLocation() |
System.Management.Automation.PathIntrinsics
is returned by the expression $ExecutionContext.SessionState.Path
$ExecutionContext.SessionState.Path.CurrentLocation $ExecutionContext.SessionState.Path.CurrentFileSystemLocation $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(".\nonexist\foo.txt")
$ExecutionContext.SessionState.Path.CurrentProviderLocation('Registry') $ExecutionContext.SessionState.Path.CurrentProviderLocation('FileSystem')
$ExecutionContext.SessionState.Path.Combine('foo\..', 'bar\baz')
evaluates to foo\..\bar\baz
. GetResolvedPSPathFromPSPath
returns an absolute path that points to the same directory or file that the relative or absolute path that was passed as argument points to if that file or directory exists, otherwise, it throws an error: $ExecutionContext.SessionState.Path.GetResolvedPSPathFromPSPath('../../xyz')
GetUnresolvedProviderPathFromPSPath
always returns an absolute path, even if the file or directory does not exist: $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath('path/that/does/../not/exist.txt')
$ExecutionContext.SessionState.Path.NormalizeRelativePath("$home/foo/bar", $home)
$ExecutionContext.SessionState.Path.ParseChildName('child/grand-child/grand-grand-child')
evaluates to grand-grand-child
. ParseParent($dir, $root)
returns the parent directory of $dir
. $root
is optional and allows to set the top-most directory of the returned directory. If this functionality is not required, this parameter must be set to $null
. $ExecutionContext.SessionState.Path.ParseParent("$home/../maria/foo.txt", $home)
evaluates to C:\Users\rene\..\maria
. $ExecutionContext.SessionState.Path.ParseParent("C:\Users\maria\foo.txt", $home)
evaluates to C:\Users\maria
. $ExecutionContext.SessionState.Path.ParseParent("$home/../../maria/foo.txt", $null)
evaluates to C:\Users\rene\..\..\maria
. $ExecutionContext.SessionState.Path.PushLocation('xyz') $ExecutionContext.SessionState.Path.SetDefaultLocationStack('xyz') $ExecutionContext.SessionState.Path.LocationStack('xyz') $ExecutionContext.SessionState.Path.PopLocation('xyz') $ExecutionContext.SessionState.Path.SetLocation(…)