-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FileCatalog cmdlets to work if -Path is not specified #5596
Conversation
… use the current working directory since -Path is not a mandatory parameter Updated tests to not specify -Path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reviewing for RC2 triage: Should process should not hardcode message string |
… use the current (PowerShell#5596) Remove unnecessary check for Paths.count > 0 as there is code later to use the current working directory since -Path is not a mandatory parameter. Updated ShouldProcess to output the internal action on adding paths rather than the user action (which is the cmdlet name). Updated tests to not specify -Path Fix PowerShell#5594
… use the current (#5596) Remove unnecessary check for Paths.count > 0 as there is code later to use the current working directory since -Path is not a mandatory parameter. Updated ShouldProcess to output the internal action on adding paths rather than the user action (which is the cmdlet name). Updated tests to not specify -Path Fix #5594
|
||
if (ShouldProcess(catalogFilePath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late. Above we made "Including path " + tempPath.ProviderPath
but here we show only path catalogFilePath
- different style message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShouldProcess()
here automatically shows the cmdlet name as the action, so it says something like: What If: Executing Test-FileCatalog against "catalogFilePath"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is about the difference - if an user set both Path
and CatalogFilePath
parameters he can get some requests for files from Path
and then different style request for catalogFilePath - he can not understand that last request is for just catalog file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both is specified, you see this:
PS C:\Users\steve\test> New-FileCatalog -Path C:\Users\steve\test,c:\,c:\Users\steve -CatalogFilePath c:\users\steve\test\test.cat -WhatIf
What if: Including path C:\Users\steve\test
What if: Including path C:\
What if: Including path C:\Users\steve
What if: Performing the operation "New-FileCatalog" on target "c:\users\steve\test\test.cat".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
Remove unnecessary check for Paths.count > 0 as there is code later to use the current working directory since -Path is not a mandatory parameter.
Updated ShouldProcess to output the internal action on adding paths rather than the user action (which is the cmdlet name).
Updated tests to not specify -Path
Fix #5594