Show password in plaintext, by using Get-Credential in PowerShell

2 Comments

  To show the password from the Get-Credentials cmdlet in plaintext,  use the following PowerShell script:   $credential = Get-Credential [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($credential .Password))

How to determine the program files folder with PowerShell, by using enums and nested types

0 Comments

If you want to use the systems “%PROGRAMFILES%” folder in PowerShell, use:   $rootInstallationFolder = [System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::ProgramFiles) $rootInstallationFolder Result C:\Program Files (x86) Note Because SpecialFolders is a nested type in System.Environment, you must use the “+”