Skip to content

Get GHOwnerRepoFromRemoteUrl

gaelcolas edited this page Mar 31, 2026 · 1 revision

Get-GHOwnerRepoFromRemoteUrl

SYNOPSIS

Extract GitHub Owner and Repository Name from Uri (ssh or https).

SYNTAX

Get-GHOwnerRepoFromRemoteUrl [[-RemoteUrl] <String>] [<CommonParameters>]

DESCRIPTION

This function will look into a remote Url (https:// or ssh://) and will extract the GitHub owner and the repository name.

from https://github.com/PowerShell/vscode-powershell/blob/master/tools/GitHubTools.psm1 Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

EXAMPLES

EXAMPLE 1

Get-GHOwnerRepoFromRemoteUrl -RemoteUrl git@github.com:gaelcolas/Sampler.GitHubTasks.git

PARAMETERS

-RemoteUrl

Remote URL of the repository, you can get it in a cloned repository by doing: git remote get-url origin

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Collections.Hashtable

NOTES

RELATED LINKS