< Back

Remove-B2Bucket

Sun Jan 19, 2020 5:52 pm

NAME Remove-B2Bucket



SYNOPSIS

Remove-B2Bucket will remove the selected bucket.

The cmdlet will only remove a bucket if the bucket is empty.





SYNTAX

Remove-B2Bucket [-BucketID] <String[]> [[-Force]] [[-ApiUri] <Uri>] [[-AccountID] <String>] [[-ApiToken] <String>]

[-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Remove-B2Bucket will remove the selected bucket.

The cmdlet will only remove a bucket if the bucket is empty.



An API key is required to use this cmdlet.





PARAMETERS

-BucketID <String[]>

The ID of the bucket to remove.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

Used to bypass confirmation prompts.



Required? false

Position? 2

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ApiUri <Uri>

The Uri for the B2 Api query.



Required? false

Position? 3

Default value $script:SavedB2ApiUri

Accept pipeline input? false

Accept wildcard characters? false



-AccountID <String>

The authorization token for the B2 account.



Required? false

Position? 4

Default value $script:SavedB2AccountID

Accept pipeline input? false

Accept wildcard characters? false



-ApiToken <String>

The authorization token for the B2 account.



Required? false

Position? 5

Default value $script:SavedB2ApiToken

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

System.String



This cmdlet takes the AccountID and ApplicationKey as strings.



System.Uri



This cmdlet takes the ApiUri as a uri.





OUTPUTS

PS.B2.Bucket



The cmdlet will output a PS.B2.Bucket object holding the bucket info.





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



PS C:\\>Remove-B2Bucket -BucketID ee7d351ff1262048503e091f



BucketName BucketID BucketType AccountID

---------- -------- ---------- ---------

stoic-barbarian-lemur 4a48fe8875c6214145260818 allPublic 010203040506



The cmdlet above will remove the bucket with the ID of ee7d351ff1262048503e091f.









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



PS C:\\>Get-B2Bucket | Remove-B2Bucket -Force



BucketName BucketID BucketType AccountID

---------- -------- ---------- ---------

stoic-barbarian-lemur 4a48fe8875c6214145260818 allPrivate 010203040506

frisky-navigator-lion 4a48fe8875c6214145260819 allPrivate 010203040506



The cmdlet above will remove all buckets associated with the account without prompting for confirmation.











RELATED LINKS

https://www.backblaze.com/b2/docs/