Fix FileCatalog cmdlets to work if -Path is not specified#5596
Fix FileCatalog cmdlets to work if -Path is not specified#5596TravisEz13 merged 1 commit intoPowerShell:masterfrom
Conversation
… use the current working directory since -Path is not a mandatory parameter Updated tests to not specify -Path
|
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
| catalogFilePath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(catalogFilePath); | ||
| } | ||
|
|
||
| if (ShouldProcess(catalogFilePath)) |
There was a problem hiding this comment.
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.
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.
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.
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".
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