Skip to content

Commit 763a0b3

Browse files
author
Dave Wyatt
committed
Small code update
Discovered PSCmdlet.GetUnresolvedProviderPathFromPSPath method, which is shorter than what I was doing to manually resolve relative paths. The functionality seems to be the same.
1 parent 13bd68e commit 763a0b3

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Commands/AddLogFileCommand.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ public string Path
4242
get { return this.path; }
4343
set
4444
{
45-
this.path = System.IO.Path.IsPathRooted(value)
46-
? value
47-
: System.IO.Path.Combine(this.SessionState.Path.CurrentLocation.Path, value);
45+
this.path = this.GetUnresolvedProviderPathFromPSPath(value);
4846
}
4947
}
5048

Commands/GetLogFileCommand.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ public string Path
2121
get { return this.path; }
2222
set
2323
{
24-
this.path = System.IO.Path.IsPathRooted(value)
25-
? value
26-
: System.IO.Path.Combine(this.SessionState.Path.CurrentLocation.Path, value);
24+
this.path = this.GetUnresolvedProviderPathFromPSPath(value);
2725
}
2826
}
2927

0 commit comments

Comments
 (0)