Search notes:

System.Security.SecureString (class)

The purpose of System.Security.SecureString is to store confidental text and to avoid storing it in process memory as plain text. The text should be erased from memory when no longer needed.
On Windows, this functionality is not supported by the OS. Therefore, it is recommended to not use SecureString when porting code to .NET.
The .NET documentation has the following important note:
A SecureString object should never be constructed from a String, because the sensitive data is already subject to the memory persistence consequences of the immutable String class. The best way to construct a SecureString object is from a character-at-a-time unmanaged source, such as the Console.ReadKey method.

Get value of a secure string

In PowerShell, the value of a secure string can be «revoverd» like so:
$password = 'secret!'
$secStr   =  convertTo-secureString -string $password -asPlainText -force
$secBstr  = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secStr)

write-host "Password is $([System.Runtime.InteropServices.Marshal]::PtrToStringAuto($secBstr))"

Not encrypted on non Windows platforms

The documentation has also the following interesting remark:
On the Windows operating system, the contents of a SecureString instance's internal character array are encrypted.

Because of this platform dependency, SecureString does not encrypt the internal storage on non-Windows platform.

See also

System.String
The PowerShell noun secureString and the option -asSecureString of the read-host cmdLet.
$host.ui.readLineAsSecureString()

Index