File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -836,13 +836,14 @@ function Set-GitHubAuthentication
836836 SecureString for use in future PowerShell sessions.
837837
838838 . EXAMPLE
839- $secureString = ("<Your Access Token>" | ConvertTo-SecureString)
839+ $secureString = ("<Your Access Token>" | ConvertTo-SecureString -AsPlainText -Force )
840840 $cred = New-Object System.Management.Automation.PSCredential "username is ignored", $secureString
841841 Set-GitHubAuthentication -Credential $cred
842+ $secureString = $null # clear this out now that it's no longer needed
843+ $cred = $null # clear this out now that it's no longer needed
842844
843- Uses the API token stored in the password field of the provided credential object for
844- authentication, and stores it in a file on the machine as a SecureString for use in
845- future PowerShell sessions.
845+ Allows you to specify your access token as a plain-text string ("<Your Access Token>")
846+ which will be securely stored on the machine for use in all future PowerShell sessions.
846847
847848 . EXAMPLE
848849 Set-GitHubAuthentication -SessionOnly
Original file line number Diff line number Diff line change @@ -71,6 +71,14 @@ access token.
7171 securely cached to disk and will persist across all future PowerShell sessions.
7272If you ever wish to clear it in the future, just call ` Clear-GitHubAuthentication ` ).
7373
74+ > For automated scenarios (like GithHub Actions) where you are dynamically getting the access token
75+ > needed for authentication, refer to ` Example 2 ` in ` Get-Help Set-StoreBrokerAuthentication -Examples `
76+ > for how to configure in a promptless fashion.
77+ >
78+ > Alternatively, you _ could_ configure PowerShell itself to always pass in a plain-text access token
79+ > to any command (by setting ` $PSDefaultParameterValues["*-GitHub*:AccessToken"] = "<access token>" ` ),
80+ > although keep in mind that this is insecure (any other process could access this plain-text value).
81+
7482A number of additional configuration options exist with this module, and they can be configured
7583for just the current session or to persist across all future sessions with ` Set-GitHubConfiguration ` .
7684For a full explanation of all possible configurations, run the following:
You can’t perform that action at this time.
0 commit comments