Compress-Archive -Path C:\Documents\* -CompressionLevel Optimal -DestinationPath C:\Archives\Documents.zip
This command:
C:\Documents
Optimal
compressionC:\Archives\Documents.zip
-DestinationPath
will add .zip
if not present.-LiteralPath
can be used if you require naming it without .zip
.