< Back

Split-GitHubUri

Sat Jan 18, 2020 9:41 pm

NAME Split-GitHubUri



SYNOPSIS

Extracts the relevant elements of a GitHub repository Uri and returns the requested element.





SYNTAX

Split-GitHubUri -Uri <String> [-RepositoryName] [<CommonParameters>]



Split-GitHubUri -Uri <String> [-OwnerName] [<CommonParameters>]





DESCRIPTION

Extracts the relevant elements of a GitHub repository Uri and returns the requested element.



Currently supports retrieving the OwnerName and the RepositoryName, when avaialable.



The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub





PARAMETERS

-Uri <String>

The GitHub repository Uri whose components should be returned.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OwnerName [<SwitchParameter>]

Returns the Owner Name from the Uri if it can be identified.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-RepositoryName [<SwitchParameter>]

Returns the Repository Name from the Uri if it can be identified.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

[PSCutomObject] - The OwnerName and RepositoryName elements from the provided URL





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Split-GitHubUri -Uri 'https://github.com/PowerShell/PowerShellForGitHub'



PowerShellForGitHub









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Split-GitHubUri -Uri 'https://github.com/PowerShell/PowerShellForGitHub' -RepositoryName



PowerShellForGitHub









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Split-GitHubUri -Uri 'https://github.com/PowerShell/PowerShellForGitHub' -OwnerName



PowerShell











RELATED LINKS