powershell zip打包文件夹
程序员文章站
2022-04-29 15:54:19
...
Here are some easy-to-use functions for zipping up a directory and unzipping usingPowershell. The functions use the opensource SharpZipLib library, a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform. So you'll need to download this and reference the SharpZipLib assembly in the appropriate place in the functions below.
function ZipFiles($sourcePath,$zipFilename) { # Reference the SharpZipLib assembly here [System.Reflection.Assembly]::LoadFrom("C:\ICSharpCode.SharpZipLib.dll") $zip = New-Object ICSharpCode.SharpZipLib.Zip.FastZip $zip.CreateZip($zipFilename,$sourcePath, $true,"") } function UnzipFiles($zipFilename,$destinationPath) { # Reference the SharpZipLib assembly here [System.Reflection.Assembly]::LoadFrom("C:\ICSharpCode.SharpZipLib.dll") $zip = New-Object ICSharpCode.SharpZipLib.Zip.FastZip $zip.ExtractZip($zipFilename,$destinationPath,"") } 我去!!!!!!发上去5分钟,TMD被踩了三次,大神能不能提出点高明的意见啊???!!! 光踩不发表意见怎么共同进步啊? 怎么显出你大神啊? 踩的很爽吧??!!! 附上SharpZipLib_0860_Bin.zip
推荐阅读
-
php打包网站并在线压缩为zip
-
ASP.NET五步打包下载Zip文件实例
-
ThinkPHP实现将本地文件打包成zip下载
-
python 实现将文件或文件夹用相对路径打包为 tar.gz 文件的方法
-
PHP实现打包zip并下载功能
-
【转】Java实现将文件或者文件夹压缩成zip
-
python压缩文件夹内所有文件为zip文件的方法
-
Python实现压缩文件夹与解压缩zip文件的方法
-
将文件夹压缩成zip文件的php代码
-
Electron – 项目打包报错(1): WARNING: Make sure that .NET Framework 4.5 or later and Powershell 3 or later are installed, otherwise extracting the Electron z