AppSettings.json PAT encryption?

We just stood up PowerShell Universal and I’m getting some things set up. One is GIT integration to Azure DevOps. I got this working however the PAT I created is in the appsettings.json file in clear text. Is there a way to encrypt this value in that file? I’ve seen it done in web.config files before but I just tried searching online and found some articles using .NET Core that looked like they would help if this was a homegrown app that we were writing. Not sure if I’m just missing something due to lack of knowledge about .NET Core.

Any input that could point me in the right direction would be greatly appreciated.

Product: PowerShell Universal
Version: 1.4.6

There isn’t a way to encrypt it but you can use environment variables rather than the appsettings.json file if you want to set it that way. It kind of depends on how you are hosting Universal but you could use Credential Manager or Azure Web App settings to provide the variable. It would then not exist on disk unencrypted.

# two underscores
$Env:Data__GitPassword = "MyPat"

Great. Thanks for the response. I’ll check it out.