Thank you @Rich Matheisen
I did the following and it seems to work:
$File = "D:\test3\Password.txt"
[Byte[]] $key = (1..16)
$Password = "supersecret" | ConvertTo-SecureString -AsPlainText -Force
$Password | ConvertFrom-SecureString -key $key | Out-File $File
$KeyFile = "D:\test3\AES.key"
$Key = New-Object Byte[] 16
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key)
$Key | out-file $KeyFile
And from the PSADT script, I added:
$File = "$ScriptDirectory\SupportFiles\Password.txt"
[Byte[]] $key = (1..16)
Get-Content $File | ConvertTo-SecureString -Key $key
The AES.key is stored somewhere else.
I would like to continue and test out the xml file you're mentioning about.
Do you know a good link where I can look and try out the XML?
I'm not sure what "create a credential on each machine" means, like user account or something else?
Thank you!