![]() Note that I added the -Force parameter to overwrite the archive that I created using the first command. This command creates an archive with just the two files explicitly listed in the – LiteralPath parameter: Compress-Archive -LiteralPath C: InvoicesFile1.txt, C:InvoicesFile2.txt -DestinationPath C:ArchivesInvoices -Force The command below will zip the Invoices folder in the root C directory and create an archive called Invoices.zip in the Archives folder: Compress-Archive -Path C:Invoices -DestinationPath C:ArchivesInvoicesĪlternatively, we could zip the files in the Invoices folder individually using -LiteralPath instead of – Path. All you need to do is use the -Path parameter to specify the folder you want to compress and the – DestinationPath parameter to specify the name of the archive you want to create. ![]() Let’s start by using PowerShell to compress files in a new zip archive. If you don’t already have PowerShell 5.0 or later installed on your systems, you can download the latest version of the Windows Management Framework from Microsoft’s website. ![]() Free Download: Windows PowerShell Scripting Tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |