Skip to content

Instantly share code, notes, and snippets.

@mayuki
Created February 27, 2010 17:35
Show Gist options
  • Select an option

  • Save mayuki/316836 to your computer and use it in GitHub Desktop.

Select an option

Save mayuki/316836 to your computer and use it in GitHub Desktop.
function Get-CredentialForWeb()
{
$cred = $null
$cred = Get-Credential
if ($cred -ne $null) {
return New-Object System.Management.Automation.PSCredential($cred.UserName.Substring(1), $cred.Password)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment