compress-archiveA cmdlet in PowerShell is used to create compressed (zipped) archive files. More information: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive.
Compress-Archive -Path {{path\to\file.txt}} -DestinationPath {{path\to\file.zip}}
Compress-Archive -Path {{path\to\file1, path\to\file2, ...}} -DestinationPath {{path\to\files.zip}}
Compress-Archive -Path {{path\to\directory}} -DestinationPath {{path\to\directory.zip}}
Compress-Archive -Path {{path\to\file}} -DestinationPath {{path\to\directory.zip}} -Update
Compress-Archive -Path {{path\to\directory}} -DestinationPath {{path\to\directory.zip}} -CompressionLevel {{Optimal|Fastest|NoCompression}}