PowerTip: Use PowerShell to Create Zip Archive

PowerTip: Use PowerShell to Create Zip Archive

  • Comments 8
  • Likes

Summary: Learn how to use Windows PowerShell to easily create a zip archive.

Hey, Scripting Guy! Question How can I use Windows PowerShell to create a zip archive of a folder on my system?

Hey, Scripting Guy! Answer Use Get-ChildItem from PSCX to copy the files, and pipe the output to the Write-Zip cmdlet:

Get-Childitem c:\fso -Recurse | Write-Zip -IncludeEmptyDirectories -OutputPath C:\fso_bu\fso.zip

Note: I have written several blog posts about the Windows PowerShell Community Extension Project.
For more information about obtaining the PSCX module, see these Hey, Scripting Guy! Blog posts.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment