Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I want to to use the Sapien credential feature and use the secure strings for API requests.
How do I place the SecureString object containing the password(Refresh token in this case) into these double quotes? In this example the refresh token.
I don't see how you can use a Windows secure string as a token for Google. I suggest posting in the Google developers forum for help with the Google APIs.
SecureString is a .NET type, which means you can only use it within PowerShell where a parameter expects a SecureString.
For any API expecting a string, you have to use, well, a string.
Our credentials in resources can retrieve your passwords as a string or as a securestring for that reason.
If you need to keep the password around in your script for repeated use, I would recommend to use a securestring
and only convert it to a string when needed.
E.g. with plainStr = new System.Net.NetworkCredential(string.Empty, secureStr).Password
Set plainStr back to NULL when done using it to minimize exposure time.
This topic is 1 year and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.