-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Copy-Item -Include -Recurse needs clarification and examples #8601
Labels
area-management
Area - Microsoft.PowerShell.Management module
issue-doc-bug
Issue - error in documentation
needs-more-info
Waiting - for more information
Comments
SteveL-MSFT
added
issue-doc-bug
Issue - error in documentation
needs-triage
Waiting - Needs triage
labels
Feb 20, 2022
5 tasks
sdwheeler
added
area-management
Area - Microsoft.PowerShell.Management module
review-shiproom
Waiting - for Shiproom discussion
and removed
needs-triage
Waiting - Needs triage
labels
Feb 22, 2022
@SteveL-MSFT There are 37 cmdlets that have |
sdwheeler
added
needs-more-info
Waiting - for more information
and removed
review-shiproom
Waiting - for Shiproom discussion
labels
Mar 9, 2022
michaeltlombardi
added a commit
to michaeltlombardi/PowerShell-Docs
that referenced
this issue
Apr 13, 2022
Prior to this commit, the documentation for the Include parameter of the Copy-Item cmdlet was unclear. This commit clarifies its functionality and adds a new example to show how it is used and where its behavior might be otherwise surprising.
michaeltlombardi
added a commit
to michaeltlombardi/PowerShell-Docs
that referenced
this issue
Apr 13, 2022
Prior to this commit, the documentation for the Include parameter of the Copy-Item cmdlet was unclear. This commit clarifies its functionality and adds a new example to show how it is used and where its behavior might be otherwise surprising.
15 tasks
sdwheeler
added a commit
that referenced
this issue
Apr 14, 2022
* (GH-8601) Clarify Include parameter for Copy-Item Prior to this commit, the documentation for the Include parameter of the Copy-Item cmdlet was unclear. This commit clarifies its functionality and adds a new example to show how it is used and where its behavior might be otherwise surprising. * Apply suggestions from code review * Added recurse example Co-authored-by: Sean Wheeler <sean.wheeler@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-management
Area - Microsoft.PowerShell.Management module
issue-doc-bug
Issue - error in documentation
needs-more-info
Waiting - for more information
Prerequisites
Version
5.1, 7.0, 7.1, 7.2, 7.3 (preview)
Link to affected document
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/copy-item?view=powershell-7.2
Description of the documentation error
The
-Include
parameter ofCopy-Item
says: "The value of this parameter qualifies the Path parameter." This is not clear to the user where they expect-Include
to filter the results, but instead is a filter on the-Path
globbing. As discussed in this issue by the Cmdlets WG PowerShell/PowerShell#16219, we believe more clarification is needed as well as some specific examples showing that-Include
filters against-Path
(whileCopy-item
does what users expect which is-Include
filters on the results).Suggested fix
Change "The value of this parameter qualifies the Path parameter." to "The value of this parameter qualifies the Path parameter. This means that
-Include
filters against the globbing (wildcard matching) result of-Path
and not against the final results. This may be unexpected behavior when used with-Recurse
as it only filters against the top level results and not the recursive results."Add examples showing that
-Path example* -Include *.txt -Recurse
would only matchexample*.txt
and not files within theexample*
folders that end in.txt
.The text was updated successfully, but these errors were encountered: