-
Notifications
You must be signed in to change notification settings - Fork 188
New GitHubReleaseAsset
Uploads a new asset for a release on GitHub.
New-GitHubReleaseAsset [-OwnerName <String>] [-RepositoryName <String>] [-Release] <Int64> -Path <String>
[-Label <String>] [-ContentType <String>] [-AccessToken <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-GitHubReleaseAsset [-Uri <String>] [[-Release] <Int64>] [-UploadUrl] <String> -Path <String>
[-Label <String>] [-ContentType <String>] [-AccessToken <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-GitHubReleaseAsset -Uri <String> [-Release] <Int64> -Path <String> [-Label <String>]
[-ContentType <String>] [-AccessToken <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Uploads a new asset for a release on GitHub.
The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub
New-GitHubReleaseAsset -OwnerName microsoft -RepositoryName PowerShellForGitHub -Release 123456 -Path 'c:\foo.zip'
Uploads the file located at 'c:\foo.zip' to the 123456 release in microsoft/PowerShellForGitHub
$release = New-GitHubRelease -OwnerName microsoft -RepositoryName PowerShellForGitHub -Tag 'stable'
$release | New-GitHubReleaseAsset -Path 'c:\bar.txt'
Creates a new release tagged as 'stable' and then uploads 'c:\bar.txt' as an asset for that release.
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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The MIME Media Type for the file being uploaded. By default, this will be inferred based on the file's extension. If the extension is not known by this module, it will fallback to using text/plain. You may specify a ContentType here to override the module's logic.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
An alternate short description of the asset. Used in place of the filename.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Owner of the repository. If not supplied here, the DefaultOwnerName configuration property value will be used.
Type: System.String
Parameter Sets: Elements
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path to the file to upload as a new asset.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
The ID of the release that the asset is for.
Type: System.Int64
Parameter Sets: Elements, Uri
Aliases: ReleaseId
Required: True
Position: 2
Default value: 0
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: System.Int64
Parameter Sets: UploadUrl
Aliases: ReleaseId
Required: False
Position: 2
Default value: 0
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Name of the repository. If not supplied here, the DefaultRepositoryName configuration property value will be used.
Type: System.String
Parameter Sets: Elements
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The value of 'upload_url' from getting the asset details.
Type: System.String
Parameter Sets: UploadUrl
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Uri for the repository. The OwnerName and RepositoryName will be extracted from here instead of needing to provide them individually.
Type: System.String
Parameter Sets: UploadUrl
Aliases: RepositoryUrl
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: System.String
Parameter Sets: Uri
Aliases: RepositoryUrl
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
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
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. Get-GitHubReleaseAsset lists the renamed filenames.
If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset.
[Back to PowerShellForGitHub]
- Add-GitHubAssignee
- Add-GitHubGistStar
- Add-GitHubIssueLabel
- Backup-GitHubConfiguration
- Clear-GitHubAuthentication
- ConvertFrom-GitHubMarkdown
- Copy-GitHubGist
- Disable-GitHubRepositorySecurityFix
- Disable-GitHubRepositoryVulnerabilityAlert
- Enable-GitHubRepositorySecurityFix
- Enable-GitHubRepositoryVulnerabilityAlert
- Get-GitHubAssignee
- Get-GitHubCloneTraffic
- Get-GitHubCodeOfConduct
- Get-GitHubConfiguration
- Get-GitHubContent
- Get-GitHubEmoji
- Get-GitHubEvent
- Get-GitHubGist
- Get-GitHubGistComment
- Get-GitHubGitIgnore
- Get-GitHubIssue
- Get-GitHubIssueComment
- Get-GitHubIssueTimeline
- Get-GitHubLabel
- Get-GitHubLicense
- Get-GitHubMilestone
- Get-GitHubOrganizationMember
- Get-GitHubPathTraffic
- Get-GitHubProject
- Get-GitHubProjectCard
- Get-GitHubProjectColumn
- Get-GitHubPullRequest
- Get-GitHubRateLimit
- Get-GitHubReaction
- Get-GitHubReferrerTraffic
- Get-GitHubRelease
- Get-GitHubReleaseAsset
- Get-GitHubRepository
- Get-GitHubRepositoryActionsPermission
- Get-GitHubRepositoryBranch
- Get-GitHubRepositoryBranchProtectionRule
- Get-GitHubRepositoryCollaborator
- Get-GitHubRepositoryContributor
- Get-GitHubRepositoryFork
- Get-GitHubRepositoryLanguage
- Get-GitHubRepositoryTag
- Get-GitHubRepositoryTeamPermission
- Get-GitHubRepositoryTopic
- Get-GitHubTeam
- Get-GitHubTeamMember
- Get-GitHubUser
- Get-GitHubUserContextualInformation
- Get-GitHubViewTraffic
- Group-GitHubIssue
- Group-GitHubPullRequest
- Initialize-GitHubLabel
- Invoke-GHRestMethod
- Invoke-GHRestMethodMultipleResult
- Join-GitHubUri
- Lock-GitHubIssue
- Move-GitHubProjectCard
- Move-GitHubProjectColumn
- Move-GitHubRepositoryOwnership
- New-GitHubGist
- New-GitHubGistComment
- New-GitHubIssue
- New-GitHubIssueComment
- New-GitHubLabel
- New-GitHubMilestone
- New-GitHubProject
- New-GitHubProjectCard
- New-GitHubProjectColumn
- New-GitHubPullRequest
- New-GitHubRelease
- New-GitHubReleaseAsset
- New-GitHubRepository
- New-GitHubRepositoryBranch
- New-GitHubRepositoryBranchProtectionRule
- New-GitHubRepositoryFork
- New-GitHubRepositoryFromTemplate
- New-GitHubTeam
- Remove-GitHubAssignee
- Remove-GitHubGist
- Remove-GitHubGistComment
- Remove-GitHubGistFile
- Remove-GitHubGistStar
- Remove-GitHubIssueComment
- Remove-GitHubIssueLabel
- Remove-GitHubLabel
- Remove-GitHubMilestone
- Remove-GitHubProject
- Remove-GitHubProjectCard
- Remove-GitHubProjectColumn
- Remove-GitHubReaction
- Remove-GitHubRelease
- Remove-GitHubReleaseAsset
- Remove-GitHubRepository
- Remove-GitHubRepositoryBranch
- Remove-GitHubRepositoryBranchProtectionRule
- Remove-GitHubRepositoryTeamPermission
- Remove-GitHubTeam
- Rename-GitHubGistFile
- Rename-GitHubRepository
- Rename-GitHubTeam
- Reset-GitHubConfiguration
- Restore-GitHubConfiguration
- Set-GitHubAuthentication
- Set-GitHubConfiguration
- Set-GitHubContent
- Set-GitHubGist
- Set-GitHubGistComment
- Set-GitHubGistFile
- Set-GitHubGistStar
- Set-GitHubIssue
- Set-GitHubIssueComment
- Set-GitHubIssueLabel
- Set-GitHubLabel
- Set-GitHubMilestone
- Set-GitHubProfile
- Set-GitHubProject
- Set-GitHubProjectCard
- Set-GitHubProjectColumn
- Set-GitHubReaction
- Set-GitHubRelease
- Set-GitHubReleaseAsset
- Set-GitHubRepository
- Set-GitHubRepositoryActionsPermission
- Set-GitHubRepositoryTeamPermission
- Set-GitHubRepositoryTopic
- Set-GitHubTeam
- Split-GitHubUri
- Test-GitHubAssignee
- Test-GitHubAuthenticationConfigured
- Test-GitHubGistStar
- Test-GitHubOrganizationMember
- Test-GitHubRepositoryVulnerabilityAlert
- Unlock-GitHubIssue