Offline Programmer

Creating A Password Protected Zip File Using PowerShell

We will use PowerShell to do the following:

  • Create a Random Password
  • Create a zip file and protect it using the random password
  • Send the zip file and the password on 2 separate emails


Creating a random password:

The script below will create a string of 8 characters which contains 2 Non Alpha Numeric Characters


Creating the Zip file:

Note the arguments section where you speicfy the password


Sending the Emails:

First let’s send the csv file as attachment

Now let’s send the password


Thanks for reading… 🙂

Filed under: Powershell, Uncategorized