-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module
Description
I quite often end up in situations where I need to remove a known number of directories from the end of a path.
Today, it requires a looping or piping multiple times to split-path.
$ancestorLevel = 4
$p = "a\b\c\d\e\f"
while($ancestorLevel--){
$p = split-path $p
}
$pWhat is the opinion around having the following?
Split-Path -Parent a\b\c\d\e\f -AncestorLevel 2
a\b\c\d
Split-Path -Parent a\b\c\d\e\f -AncestorLevel 4
a\bBetter naming is left as an exercise for attentive readers with English as their native toungue.
Metadata
Metadata
Assignees
Labels
Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Cmdlets-Managementcmdlets in the Microsoft.PowerShell.Management modulecmdlets in the Microsoft.PowerShell.Management module