< Back

Get-B2Bucket

Sun Jan 19, 2020 5:51 pm

NAME Get-B2Bucket



SYNOPSIS

The Get-B2Bucket cmdlet will list buckets associated with the account.





SYNTAX

Get-B2Bucket [[-ApiUri] <Uri>] [[-AccountID] <String>] [[-ApiToken] <String>] [<CommonParameters>]





DESCRIPTION

The Get-B2Bucket cmdlet will list buckets associated with the account.



An API key is required to use this cmdlet.





PARAMETERS

-ApiUri <Uri>

The Uri for the B2 Api query.



Required? false

Position? 1

Default value $script:SavedB2ApiUri

Accept pipeline input? false

Accept wildcard characters? false



-AccountID <String>

The account ID for the B2 account.



Required? false

Position? 2

Default value $script:SavedB2AccountID

Accept pipeline input? false

Accept wildcard characters? false



-ApiToken <String>

The authorization token for the B2 account.



Required? false

Position? 3

Default value $script:SavedB2ApiToken

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:\\>Get-B2Bucket



BucketName BucketID BucketType AccountID

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

awsome-jack-fang 4a48fe8875c6214145260818 allPrivate 30f20426f0b1

Kitten Videos 5b232e8875c6214145260818 allPublic 30f20426f0b1



The cmdlet above will return all buckets for the account.









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



PS C:\\>Get-B2Bucket | Where-Object {$_.BucketName -eq 'awsome-jack-fang'}



BucketName BucketID BucketType AccountID

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

awsome-jack-fang 4a48fe8875c6214145260818 allPrivate 30f20426f0b1



The cmdlet above will return all buckets and search for the one with

a name of awsome-jack-fang.











RELATED LINKS

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