Step1 : need to zip below three files in same location with holds.zip Path: D:\Project\extensions\files inside this path having households filefolder xmldocument dll need to zip the file with these three files Step2:once zipped(holds.zip) delete the zip file and copy in D:\Project\extensions
using this command but not getting the required output Compress-Archive -Path D:\Project\extensions\files -DestinationPath D:\Project\extensions\files
I tried re-creating the scenario you mentioned as follows:
Created a directory "D:\Project\extensions\files" that contains the following items:
I executed the below PS script and it archived the folder contents in same location:
$compress = @{
Path = "D:\Project\extensions\files"
CompressionLevel = "Fastest"
DestinationPath = "D:\Project\extensions\files\holds.zip"
}
Compress-Archive @compress
Once the zip file was generated, I used the below cmdlet to delete it & move to "D:\Project\extensions" path:
Move-Item "D:\Project\extensions\files\holds.zip" "D:\Project\extensions\holds.zip"
Hope this solution meets your requirements!