April 14, 2020 at 5:44 am #218355ParticipantTopics: 1Replies: 1Points: 18Rank: Member
while my command like this:
Copy-Item ‘C:\trans\*’-Include ‘*.flv’ -Destination ‘C:\test\’ -Recurse -Force
but it does not work
while i change the “-include” into “-exclude” it really work ;
I don’t know why
April 14, 2020 at 7:26 am #218376ParticipantTopics: 4Replies: 2247Points: 5,484Rank: Community MVP
Inaho, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.
When you post code or error messages or sample data or console output format it as code using the code tags “PRE“, please. Thanks in advance.
What exactly do you mean with:
… does not work
What is in your source directory and what would you expect to happen? You could try the parameter -Filter instead.
Copy-Item 'C:\trans\*' -Filter '*.flv' -Destination 'C:\test\' -Recurse -Force
April 14, 2020 at 1:50 pm #218478
April 15, 2020 at 4:40 am #218745ParticipantTopics: 1Replies: 1Points: 18Rank: Member
I did this ,but nothing has be copied still.
April 15, 2020 at 6:53 am #218787ParticipantTopics: 4Replies: 2247Points: 5,484Rank: Community MVP
What happens when you use Get-ChildItem with the parameter you use for Copy-Item?
Get-ChildItem -Path 'C:\trans\*' -Include '*.flv' -Recurse
You might try it with the parameter -Filter as well …
Get-ChildItem -Path 'C:\trans\*' -Filter '*.flv' -Recurse
- You must be logged in to reply to this topic.