Adding -Extension and -LeafBase switches to Split-Path - #2721
Conversation
|
Hi Staffan Gustafsson (@powercode), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
fd24ea2 to
e8e7f40
Compare
There was a problem hiding this comment.
should there be explicit tests for things like:
"$level2_1Full$fileExt$fileExt"
to ensure that the trimming is not over-zealous?
There was a problem hiding this comment.
Added.
e8e7f40 to
ef0abc9
Compare
There was a problem hiding this comment.
What's the difference between LeafSet and LeafBaseSet?
There was a problem hiding this comment.
The comment seems to be duplicated.
There was a problem hiding this comment.
The default value of _parent used to be true. The default for a switch is False. Please revisit.
There was a problem hiding this comment.
Good catch. Fixing and rebasing.
…No functionallity changes Using auto properties when no when there is no logic in getter/setter Removing unused code Removing redundant qualifiers Removing Redundant initializers
Extension and LeafBase are specializations of Leaf, and uses System.IO.Path.GetExtension and System.IO.Path.GetFilenameWithoutExtension to extract parts from the Leaf
ef0abc9 to
33e266e
Compare
|
Charu Bassi (@charub) your comments have been addressed, can you please take another look? If the change looks good, please approve the PR. |
* Refactoring ParsePathCommand.cs (SplitPathCommand) for readability - Using auto properties when no when there is no logic in getter/setter - Removing unused code - Removing redundant qualifiers - Removing Redundant initializers * Add -Extension and -Leafbase switches to Split-Path cmdlet - Extension and LeafBase are specializations of Leaf, and uses System.IO.Path.GetExtension and System.IO.Path.GetFilenameWithoutExtension to extract parts from the Leaf * Adding tests for Split-Path -LeafBase and Split-Path -Extension
Fixes #2700
Extension and LeafBase are specializations of Leaf, and uses System.IO.Path.GetExtension
and System.IO.Path.GetFilenameWithoutExtension to extract parts from the Leaf
Tests added in test\powershell\Modules\Microsoft.PowerShell.Management\FileSystem.Tests.ps1