Last active
June 11, 2018 17:28
-
-
Save trodemaster/954915a55dd0f6714c60a671939c704d to your computer and use it in GitHub Desktop.
Verify that powershell is set to prompt for credentials at the CLI and not popup a dialog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # prompt for passwords on the cli only | |
| if ($psversiontable.platform -ne "Unix") { | |
| $CONSOLE_PROMPTING = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds" -Name "ConsolePrompting" -EA 0 | |
| if ($CONSOLE_PROMPTING.ConsolePrompting -ne $true) { | |
| Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds" -Name "ConsolePrompting" -Value $True | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to only check this on non Unix platform AKA windows