r/PowerShell • • Aug 11 '26

Question Question on scripting

Hi,

When we develop a script,we use credentials as a plain text in that script.

Example

Script is running on jump server and script runs against vcenter server.

We have a security concerns(example ransomware attack)to put the credentials as a plain text in that script.

Any other good ways to put the credentials in a encrypted or in a different format?

35 Upvotes

36 comments sorted by

View all comments

Show parent comment

17

u/Kroan Aug 11 '26

What does "export-clixml can be hacked sometimes" even mean? Do you mean import-clixml? Even that doesn't make sense. It's just importing an xml file to create a powershell object. The contents aren't necessarily secure.

But in this case the contents are a secure string. Which can only be decrypted by the originating account on the originating workstation. And if you're concerned about someone/something having that access and decrypting it, you have bigger problems