Set-Ssh Configure or convert the published location to SSH-based access.
Description
Set-Ssh sets the published location for the active project folder to an SSH URL. If you do not provide one, Set-Ssh reads the existing HTTPS URL and converts it to its SSH form (for example, https://github.com/example/repo.git becomes git@github.com:example/repo.git). Use it when SSH is preferred over HTTPS, or when corporate environments require key-based authentication.
Recipes
Recipe 1
EXAMPLE 1
Set-Ssh
Recipe 2
EXAMPLE 2
Set-Ssh -RemoteUrl 'git@github.com:example/repo.git'
Notes
Safety:
- Do not commit private keys.
- After Set-Ssh, run Test-Login to confirm key-based authentication works.
- If SSH unexpectedly prompts for credentials, run Show-Remote and verify the URL.
Parameters
-RemoteName optional String
The name of the published location to configure. Defaults to origin.
-RemoteUrl optional String
Optional SSH URL. If omitted, Set-Ssh converts the existing HTTPS URL.
-LogPath optional String
Override the directory where the diagnostic log for this run is written.
-WhatIf optional SwitchParameter
-Confirm optional SwitchParameter
Was this page helpful? Report an issue or suggest an improvement →