分享: 把 C:\Share 中超過 60 天未異動的 *.doc? 檔,搬移到 C:\Archive 中

Discussion 分享: 把 C:\Share 中超過 60 天未異動的 *.doc? 檔,搬移到 C:\Archive 中

  • 2011年9月23日 上午 05:54
     
     

    $sourceFolder="C:\Share"

    Get-ChildItem $sourceFolder -filter "*.doc?" -recurse | `
    where-object { $_.mode.startswith("-") -and ((get-date)-$_.LastWriteTime).days -gt 60 } | `
    move-item -Destination c:\archive


    蘇建榮