标签:pre code select time mes top err desc tin
#source1 file location $source1 = "C:\users\me\desktop\test1" #dest1 file location $dest1 = "C:\users\me\desktop\final\" #finds files in $source1 that are the very latest and copies to $dest1 try { Get-ChildItem $source1 -Recurse | Sort-Object -Property CreationTime -Descending | Select-Object -First 1 | Copy-Item -Destination $dest1 -ErrorAction ‘Stop‘ } catch{ $_.Exception.Message | Out-File -FilePath .\errorlog.txt -Encoding utf8 }
标签:pre code select time mes top err desc tin
原文地址:https://www.cnblogs.com/JinweiChang/p/11400647.html