Skip to content

Block-GitHubUser

SYNOPSIS

Block a user from user or an organization.

SYNTAX

__AllParameterSets (Default)

Block-GitHubUser -Username <String> [-Organization <String>] [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Organization

Block-GitHubUser -Username <String> -Organization <String> [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Blocks the given user and returns true. If the user cannot be blocked false is returned.

EXAMPLES

EXAMPLE 1

Block-GitHubUser -Username 'octocat'

Blocks the user 'octocat' for the authenticated user. Returns $true if successful, $false if not.

EXAMPLE 2

Block-GitHubUser -Organization 'GitHub' -Username 'octocat'

Blocks the user 'octocat' from the organization 'GitHub'. Returns $true if successful, $false if not.

PARAMETERS

-Username

The handle for the GitHub user account.

Type: String
Parameter Sets: (All)
Aliases: login

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

-Organization

The organization name. The name is not case sensitive.

Type: String
Parameter Sets: __AllParameterSets
Aliases: owner, org

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: Organization
Aliases: owner, org

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

-Context

The context to run the command in. Used to get the details for the API call. Can be either a string or a GitHubContext object.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: (Get-GitHubContext)
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

OUTPUTS

System.Boolean

NOTES

Block a user Block a user from an organization