Skip to content

Commit

Permalink
cleaning username a win8 compat way
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Cromwell committed Aug 23, 2012
1 parent 1abdf02 commit 2cd6c45
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions PsGist.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function Get-Github-Credential($username) {
$host.ui.PromptForCredential("Github Credential", "Please enter your Github user name and password.", $username, "")
}

function Clean-Username($username) {
$username.Replace("\", "")
}

function New-DiffGist {
<#
.Synopsis
Expand Down Expand Up @@ -72,7 +76,7 @@ function New-DiffGist {
return
}

$username = $credential.Username
$username = (Clean-Username $credential.Username)
$password = $credential.Password

$bstrpassword= [Runtime.InteropServices.Marshal]::SecureStringToBSTR($password)
Expand Down Expand Up @@ -226,7 +230,7 @@ function New-Gist {
return
}

$username = $credential.Username
$username = (Clean-Username $credential.Username)
$password = $credential.Password

$bstrpassword= [Runtime.InteropServices.Marshal]::SecureStringToBSTR($password)
Expand Down Expand Up @@ -295,4 +299,4 @@ new-alias Create-Gist New-Gist # For those who saw my post when I used create...
new-alias diffgist New-DiffGist

export-modulemember -alias * -function New-Gist
export-modulemember -alias * -function New-DiffGist
export-modulemember -alias * -function New-DiffGist

0 comments on commit 2cd6c45

Please sign in to comment.