[英]How to add Windows Credentials via Powershell?
I am trying to add Windows Credentials for my Github account via powershell.我正在尝试通过 powershell 为我的 Github 帐户添加 Windows 凭据。
I type in the below command into powershell:我在 powershell 中输入以下命令:
cmdkey /add:"git:https://github.com" /user:"myusername" /pass:"myauthtoken"
It returns error CMDKEY: The parameter is incorrect.
它返回错误
CMDKEY: The parameter is incorrect.
How can I fix this?我怎样才能解决这个问题?
Note that the above parameter values work when I add credentials via gui with Control Panel -> Credential Manager -> Add a Generic Credential.请注意,当我使用控制面板 -> 凭据管理器 -> 添加通用凭据通过 gui 添加凭据时,上述参数值有效。
From the output of cmdkey /?
从 output 的
cmdkey /?
: :
To create generic credentials: The /add switch may be replaced by /generic to create generic credentials
If I take a look at the generic github credentials in my vault, their target name is listed as:如果我查看我的保管库中的通用 github 凭据,它们的目标名称列为:
Target: LegacyGeneric:target=git:https://github.com
So, I'd suggest trying the following:所以,我建议尝试以下操作:
cmdkey /generic:LegacyGeneric:target=git:https://github.com /user:"myusername" /pass:"myauthtoken"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.