Questions tagged [compress-archive]

36 questions
7
votes
1 answer

How do I compress files using powershell that are over 2 GB?

I am working on a project to compress files that range anywhere from a couple mb to several gb's big and I am trying to use powershell to compress them into a .zip. The main problem I am having is that using Compress-Archive has a 2 Gb cap to…
6
votes
1 answer

Compress-Archive, exclude the containing folder

I need to pack a folder using Compress-Archive in PShell My folder structure is as following: |- C:\MyFolder |--- Files |------ Start.ps1 |------ Stop.ps1 |--- Manifests |------ Start.xml |------ Stop.xml When I issue this command Compress-Archive…
Raffaeu
  • 6,694
  • 13
  • 68
  • 110
2
votes
1 answer

Powershell command Compress-Archive incredibly slow

I'm new to windows development and I'm attempting using github actions to do a build/deploy. In the build step I compress my project and upload it jobs: build: runs-on: windows-latest steps: - uses: actions/checkout@v2 -…
2
votes
1 answer

PowerShell - Double loop possible?

I want to compress a directory in a specific place. The source path is : \\$Computers\Users\$Names I want than for each computers a copy of each users directory in the sources path of each computers I tried to use a foreach loop like : $Computers =…
Lafiota
  • 35
  • 3
2
votes
1 answer

Using Compress-Archive to compress multiple folders multithreadded with Powershell

Everyday I need create archives of the following C:. └───1.Jan ├───20000 │ img1.bmp │ img2.bmp │ img3.bmp │ ├───20001 │ img1.bmp │ img2.bmp │ img3.bmp │ ├───20002 │ …
zPRAWN
  • 25
  • 4
2
votes
2 answers

checking if Compress-Archive can produce a true/false based on success of the archival of a file

I have the following code: $items = Get-ChildItem -Path 'D:\Myoutput\' $items | ForEach-Object { $lastWrite = ($_).LastWriteTime $timespan = New-Timespan -days 3 -hours 0 -Minutes 0 if(((get-date) - $lastWrite) -gt $timespan) { $name =…
mbala1230
  • 23
  • 2
2
votes
2 answers

PowerShell: using Compress-Archive with Start-Job won't work

I'm trying to use PowerShell to compress a bunch of video files on my H:\ drive. However, running this serially would take a long time as the drive is quite large. Here is a short snippet of the code that I'm using. Some parts have been…
Henry Yam
  • 23
  • 3
2
votes
1 answer

Archive all files of a certain type recursively from powershell

Is there a way to use Compress-Archive script, that when run from a path: archives all files matching a wildcard filter (*.doc, for example) archives such files in the current folder and all children folders save the relative folder structure (the…
scott.se
  • 70
  • 1
  • 8
1
vote
0 answers

Why is a string containing comma separated paths built using join not accepted as a path when attempting Compress-Archive in Powershell

Compress-Archive states that the Path parameter accepts a comma separated list of directories. -Path Specifies the path or paths to the files that you want to add to the archive zipped file. To specify multiple paths, and include files in multiple…
1
vote
0 answers

Is there an error-less PowerShell equivalent to: tar cfz hierarchy.tgz hierarchy

In GNU/Linux, I can just do this: tar cfz hierarchy.tgz hierarchy and it just works, even if some of the items in hierarchy are being used by other processes. In Windows, I can right-click on a folder and send it to a compressed zip file, so long…
gknauth
  • 2,310
  • 2
  • 29
  • 44
1
vote
1 answer

Modify and ZIP file in one statement

PSVersion 5.1.18362.2212 I would like to know if it is possible to read in a set of text files, modify their content and their filenames and store the results directly into a ZIP file? The following reads text files in and modifies them, storing the…
Eric
  • 1,321
  • 2
  • 15
  • 30
1
vote
1 answer

Powershell script to zip folder base on their name with the command compress-archive

I'm trying to compress each folder in my directory into a zip with the same name I tried the simple compress-archive command Compress-Archive $targetFolderPath -Destination $zipFolder -Update but it gives me only one zip named ".zip" with all my…
1
vote
1 answer

Running Compress-Archive with Read-Host

I will be running the script from the machine where I'd like the compressed file to be placed, in the path specified. I want to compress the folder from the UNC path (from the first Read-Host), and place a copy of the resulting .zip file into the…
1
vote
1 answer

Powershell Compress-Archive include empty directories

I need to include empty directories along with files in a zip file. I can do this manually just fine with 7-Zip but I wanted to automate it because I do this quite a lot. I recently started learning powershell so I decided to give it a go. My…
1
vote
1 answer

Powershell Creates Different Zip File?

I'm creating a zip file from a directory in two ways in Win10. The first method using "Right-Click...Send To...Compressed (zipped) folder" The second method using Powershell Compress-Archive. I wanted to automate the process using Powershell. The…
1
2 3