I have a really simple question which I am sure someone can answer really quickly for me.
I have one text file (password.txt) containing a random string of characters which has been generated by a Poweshell script to be used as a wifi password.
I have another script (change-password.ps1) which logs into my router and changes the password. I have managed to get this script to look at a json file (config.json) and use one of static passphrases.
This is my json file
{ "PSKs": {
"01":"PSKforJanuary123!!",
"02":"PSKforFebruary123!",
"03":"PSKforMarch123!",
"04":"PSKforApril123!",
"05":"PSKforMay123!",
"06":"PSKforJune123!",
"07":"PSKforJuly123!",
"08":"PSKforAugust123!",
"09":"PSKforSeptember123!",
"10":"PSKforOctober123!",
"11":"PSKforNovember123!",
"12":"PSKforDecember123!"
}
}
So instead of using one of these from the list above, how can I replace the "PSKfor***123!" with the line of text from my password.txt?
Or is there a way I can create this random string of characters within my json file without having to run another script to generate it?
Thanks in advance!
PSKformonth123? The one that corresponds with the current month (i.e.:12in this case) ? These clarifications should be in your question