This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#AES Key file export location | |
$KeyFile = "C:\AES.key" | |
#Generate Key | |
$Key = New-Object Byte[] 16 # You can use 16, 24, or 32 for AES | |
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key) | |
#write key to file | |
$Key | out-file $KeyFile |