Word – Powershell to encrypt text file with password or string

command lineencryptionpasswordspowershell

I'm running a shared computer with command prompt access, and I want to be able to encrypt and decrypt a text file from a powershell script, with a unique user-identified password. This way the file could not be opened without that password. I tried to use this module, however it seems to need something called a certificate. All I want is a powershell script that could be called with something like -Encrypt -File "Path\To\File" -Password -"12345" (and something similar to decrypt it). Does such a tool exist? If not, how would I go about doing this?

Best Answer

This script from the PS gallery might do the trick; https://gallery.technet.microsoft.com/scriptcenter/EncryptDecrypt-files-use-65e7ae5d

UPDATE: the gallery has been removed. I cant find a migrated version anywhere but the webarchive has a copy: https://web.archive.org/web/20200318045131/https://gallery.technet.microsoft.com/scriptcenter/EncryptDecrypt-files-use-65e7ae5d

Related Question