$SourcePath = "D:\Reports\DeskReports\2016Q2"
$ArchivePath = "D:\Reports\DeskReports\Archive_2016Q2"
$7ZipPath = "D:\data\7-Zip\7z.exe"

Get-ChildItem -Path $SourcePath -Recurse | Where-Object {$_.PSIsContainer} | ForEach-Object {
$directoryFullName = $_.FullName
$directoryName = $_.Name
Invoke-Expression -Command "$7ZipPath a $ArchivePath\$directoryName.zip $directoryFullName\*"
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-06-10
  • 2021-07-24
猜你喜欢
  • 2021-06-02
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2021-06-20
  • 2022-12-23
相关资源
相似解决方案