New GitHubRepository - X-Guardian/PowerShellForGitHub GitHub Wiki

New-GitHubRepository

SYNOPSIS

Creates a new repository on GitHub.

SYNTAX

New-GitHubRepository [-RepositoryName] <String> [[-OrganizationName] <String>] [[-Description] <String>]
 [[-Homepage] <String>] [[-GitIgnoreTemplate] <String>] [[-LicenseTemplate] <String>] [[-TeamId] <Int64>]
 [-Private] [-NoIssues] [-NoProjects] [-NoWiki] [-AutoInit] [-DisallowSquashMerge] [-DisallowMergeCommit]
 [-DisallowRebaseMerge] [-DeleteBranchOnMerge] [-IsTemplate] [[-AccessToken] <String>] [-NoStatus] [-WhatIf]
 [-Confirm] [<CommonParameters>]

DESCRIPTION

Creates a new repository on GitHub.

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

EXAMPLES

EXAMPLE 1

New-GitHubRepository -RepositoryName MyNewRepo -AutoInit

EXAMPLE 2

'MyNewRepo' | New-GitHubRepository -AutoInit

EXAMPLE 3

New-GitHubRepository -RepositoryName MyNewRepo -Organization MyOrg -DisallowRebaseMerge

PARAMETERS

-AccessToken

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.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-AutoInit

Specify this to create an initial commit with an empty README.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-DeleteBranchOnMerge

Specifies the automatic deleting of head branches when pull requests are merged.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Description

A short description of the repository.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-DisallowMergeCommit

By default, merging pull requests with a merge commit will be allowed. Specify this to disallow.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-DisallowRebaseMerge

By default, rebase-merge pull requests will be allowed. Specify this to disallow.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-DisallowSquashMerge

By default, squash-merging pull requests will be allowed. Specify this to disallow.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-GitIgnoreTemplate

Desired language or platform .gitignore template to apply. For supported values, call Get-GitHubGitIgnore. Values are case-sensitive.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-Homepage

A URL with more information about the repository.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-IsTemplate

Specifies whether the repository is made available as a template.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-LicenseTemplate

Choose an open source license template that best suits your needs. For supported values, call Get-GitHubLicense Values are case-sensitive.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-NoIssues

By default, this repository will support Issues. Specify this to disable Issues.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-NoProjects

By default, this repository will support Projects. Specify this to disable Projects. If you're creating a repository in an organization that has disabled repository projects, this will be true by default.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-NoStatus

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.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-NoWiki

By default, this repository will have a Wiki. Specify this to disable the Wiki.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-OrganizationName

Name of the organization that the repository should be created under. If not specified, will be created under the current user's account.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Private

By default, this repository will be created Public. Specify this to create a private repository.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-RepositoryName

Name of the repository to be created.

Type: System.String
Parameter Sets: (All)
Aliases: Name

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-TeamId

The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.

Type: System.Int64
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
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

GitHub.Branch

GitHub.Content

GitHub.Event

GitHub.Issue

GitHub.IssueComment

GitHub.Label

GitHub.Milestone

GitHub.PullRequest

GitHub.Project

GitHub.ProjectCard

GitHub.ProjectColumn

GitHub.Release

GitHub.Repository

OUTPUTS

GitHub.Repository

NOTES

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️