< Back
Get-GitHubCodeOfConduct
Post
NAME Get-GitHubCodeOfConduct
SYNOPSIS
Gets license or license content from GitHub.
SYNTAX
Get-GitHubCodeOfConduct [-OwnerName <String>] [-RepositoryName <String>] [-AccessToken <String>] [-NoStatus]
[-WhatIf] [-Confirm] [<CommonParameters>]
Get-GitHubCodeOfConduct -Uri <String> [-AccessToken <String>] [-NoStatus] [-WhatIf] [-Confirm] [<CommonParameters>]
Get-GitHubCodeOfConduct -Name <String> [-AccessToken <String>] [-NoStatus] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
Gets license or license content from GitHub.
The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub
PARAMETERS
-OwnerName <String>
Owner of the repository.
If not supplied here, the DefaultOwnerName configuration property value will be used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RepositoryName <String>
Name of the repository.
If not supplied here, the DefaultRepositoryName configuration property value will be used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Uri <String>
Uri for the repository.
The OwnerName and RepositoryName will be extracted from here instead of needing to provide
them individually.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <String>
The name of the license to retrieve the content for. If not specified, all licenses
will be returned.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AccessToken <String>
If provided, this will be used as the AccessToken for authentication with the
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-NoStatus [<SwitchParameter>]
If this switch is specified, long-running commands will run on the main thread
with no commandline status update. When not specified, those commands run in
the background, enabling the command prompt to provide status information.
If not supplied here, the DefaultNoStatus configuration property value will be used.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Required? false
Position? named
Default value
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
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-GitHubCodeOfConduct
Returns metadata about popular Codes of Conduct
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-GitHubCodeOfConduct -Name citizen_code_of_conduct
Gets the content of the 'Citizen Code of Conduct'
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-GitHubCodeOfConduct -OwnerName Microsoft -RepositoryName PowerShellForGitHub
Gets the content of the Code of Coduct file for the Microsoft\\PowerShellForGitHub repository
if one is detected.
It may be necessary to convert the content of the file. Check the 'encoding' property of
the result to know how 'content' is encoded. As an example, to convert from Base64, do
the following:
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($result.content))
RELATED LINKS
SYNOPSIS
Gets license or license content from GitHub.
SYNTAX
Get-GitHubCodeOfConduct [-OwnerName <String>] [-RepositoryName <String>] [-AccessToken <String>] [-NoStatus]
[-WhatIf] [-Confirm] [<CommonParameters>]
Get-GitHubCodeOfConduct -Uri <String> [-AccessToken <String>] [-NoStatus] [-WhatIf] [-Confirm] [<CommonParameters>]
Get-GitHubCodeOfConduct -Name <String> [-AccessToken <String>] [-NoStatus] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
Gets license or license content from GitHub.
The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub
PARAMETERS
-OwnerName <String>
Owner of the repository.
If not supplied here, the DefaultOwnerName configuration property value will be used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RepositoryName <String>
Name of the repository.
If not supplied here, the DefaultRepositoryName configuration property value will be used.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Uri <String>
Uri for the repository.
The OwnerName and RepositoryName will be extracted from here instead of needing to provide
them individually.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <String>
The name of the license to retrieve the content for. If not specified, all licenses
will be returned.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AccessToken <String>
If provided, this will be used as the AccessToken for authentication with the
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-NoStatus [<SwitchParameter>]
If this switch is specified, long-running commands will run on the main thread
with no commandline status update. When not specified, those commands run in
the background, enabling the command prompt to provide status information.
If not supplied here, the DefaultNoStatus configuration property value will be used.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Required? false
Position? named
Default value
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
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Get-GitHubCodeOfConduct
Returns metadata about popular Codes of Conduct
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>Get-GitHubCodeOfConduct -Name citizen_code_of_conduct
Gets the content of the 'Citizen Code of Conduct'
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Get-GitHubCodeOfConduct -OwnerName Microsoft -RepositoryName PowerShellForGitHub
Gets the content of the Code of Coduct file for the Microsoft\\PowerShellForGitHub repository
if one is detected.
It may be necessary to convert the content of the file. Check the 'encoding' property of
the result to know how 'content' is encoded. As an example, to convert from Base64, do
the following:
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($result.content))
RELATED LINKS