Skip to content

Instantly share code, notes, and snippets.

@trodemaster
Last active June 11, 2018 17:28
Show Gist options
  • Select an option

  • Save trodemaster/954915a55dd0f6714c60a671939c704d to your computer and use it in GitHub Desktop.

Select an option

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
# 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
}
}
@trodemaster
Copy link
Author

Updated to only check this on non Unix platform AKA windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment