Powershell Copy-Item -Destination [duplicate]
问题 This question already has answers here : Powershell 2 copy-item which creates a folder if doesn't exist (9 answers) Closed 3 years ago . Get-ChildItem -Path \\$SiteMachineName\c$\ProgramData\Scripts\log -Recurse | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-40)} | select * | Select -ExpandProperty FullName | Copy-Item -Destination C:\Users\<username>\Desktop\PS This is the script I'm trying to run, It grabs all the files older then 40 days from the script folder on a remote machine