Closed felixfbecker closed 6 years ago
@pcgeek86 so I am trying to make Set-GitHubToken
work cross-platform and it turns out that ConvertFrom-SecureString
is not available on Linux/macOS and won't be, maybe ever: https://github.com/PowerShell/PowerShell/issues/1654
So it's impossible on Linux/macOS to store an intransparently-encrypted version of the token on disk. On macOS maybe you could put it in the keychain.
So instead of forcing a decision on the user to store the token in plaintext, I would propose shifting that decision to the user by taking -Token
on every function and letting them use $PSDefaultParameterValues
- then every user can decide how they want to store it, they just need to set it in their profile.ps1.
@felixfbecker I like that idea of using -Token
. Maybe keep the old behavior if -Token
is not provided, to prevent a breaking change? But -Token
will be a requirement for Linux/macOS and should throw if not provided?
explorer
doesn't work on macOS/Linux (and most people would likely prefer a different browser)Get-Credential
is called with-UserName <GitHubUsername>
, which means the user name is not prompted for, instead it is literally set to<GitHubUsername>
:PowerShell credential request Please enter your GitHub username and Personal Access Token. Visit https://github.com/settings/tokens to obtain a Personal Access Token. Password for user: