Encrypt Files With EFS

by Mar 31, 2011

You should first access the file using Get-Item to encrypt a file with EFS:

$file = Get-Item c:\somefile.txt

Next, call its Encrypt() method. Provided that EFS is available on your system, the file will be  encrypted, and in Windows Explorer, the file will now get a green label:

$file.Encrypt()

You should use

$file.Decrypt()

to undo encryption.

 

 

Twitter This Tip!
ReTweet this Tip!