Need help creating an encrypted string

I created a script to get fields using read-host, there are 5 fields, all of the fields are to be encrypted and saved to a config file.  2 of the five are not saved as encrypted strings, the from and To address, all other fields are encrypted.  I've included a copy of the Config file.

I'm sure its something simple but I don't see what I am doing wrong, need some help

Thanks
from.txt
sendfile.txt
c7c4c7Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
clockwatcherConnect With a Mentor Commented:
You're missing the $ in front of your variable names in those two cases.  Change this:

out-file -filepath C:\bat\sendfile.config -inputobject encrypted_fromAddress_string -append
out-file -filepath C:\bat\sendfile.config -inputobject encrypted_toAddress_string -append

Open in new window


to
out-file -filepath C:\bat\sendfile.config -inputobject $encrypted_fromAddress_string -append
out-file -filepath C:\bat\sendfile.config -inputobject $encrypted_toAddress_string -append

Open in new window

0
 
Meir RivkinFull stack Software EngineerCommented:
in from.txt:
you forgot the $ sign for encrypted_fromAddress_string and encrypted_toAddress_string when u use out-file.
0
 
c7c4c7Author Commented:
Thanks, I new it would be simple I just couldn't see it
0
All Courses

From novice to tech pro — start learning today.