Skip to content

Provide better working copy SSH key clip command that doesn't fail on PowerShell #25909

@nam20485

Description

@nam20485

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account#adding-a-new-ssh-key-to-your-account

The Adding a new SSH key to your account section of the Add a new SSH Key page at the path Authentication \ Connect with SSH

What part(s) of the article would you like to see updated?

The 'clip' command from step 1 of the "Adding a new SSH key to your account" section...

On Windows 11 and some Windows 10 systems, Windows Terminal has replaced the cmd.exe as the default terminal. Windows Terminal uses the PowerShell shell by default. The provided 'clip' command for Windows will result in an error because the '<' operator does not function the same in PowerShell. It does not pipe output of the command following it to the command preceding it, but instead produces an error (see screenshot below) stating:

"ParseError: The '<' operator is reserved for future use."

For many of the users who do not understand the error message or have an advanced understanding of shell command syntax, the error will result in them not being able to copy the SSH key to add to their GitHub account, and they will have to go searching Google for a method that will work, or worst-case, giving up.

Providing the alternative, working command will allow these users to successfully complete the step, quickly and easily.

Alternatively, you could replace the first command with the one I provided, as I believe it will work successfully in more user cases than the provided one.

Additional information

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions