< Back

Get-B2ChildItem

Sun Jan 19, 2020 5:51 pm

NAME Get-B2ChildItem



SYNOPSIS

The Get-B2ChildItem cmdlet will return a list of items in a bucket and associated file properties.





SYNTAX

Get-B2ChildItem [-BucketID] <String[]> [[-StartName] <String>] [[-ItemCount] <UInt32>] [[-ApiUri] <Uri>]

[[-ApiToken] <String>] [<CommonParameters>]





DESCRIPTION

The Get-B2ChildItem cmdlet will return a list of items in a bucket and associated file properties.



The file information to be returned:



- Name

- Size

- UploadTime

- Action

- ID



By default the selection has a hard limit to the first 1000 items; to increment the selection

use the StartName paramter to specifiy the next starting item's name and ItemCount to set the

list limit from the file in StartName.



An API key is required to use this cmdlet.





PARAMETERS

-BucketID <String[]>

The ID of the bucket to query.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-StartName <String>

The name of the item to start listing from.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ItemCount <UInt32>

The number of items to return; the default and max is 1000.



Required? false

Position? 2

Default value 1000

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



-ApiToken <String>

The authorization token for the B2 account.



Required? false

Position? 4

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



OUTPUTS

PS.B2.File



The cmdlet will output a PS.B2.File object holding file version info.





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



PS C:\\>Get-B2ChildItem -BucketID 4a48fe8875c6214145260818



Name : items/hello.txt

Size : 6

UploadTime : 1439083733000

Action : upload

ID : 4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6b_d20150809_m012853_c100_v0009990_t0000



Name : items/world.txt

Size : 6

UploadTime : 1439083734000

Action : upload

ID : 4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6c_d20150809_m012854_c100_v0009990_t0000



The cmdlet above will list the first 1000 items in a given bucket.









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



PS C:\\>Get-B2ChildItem -BucketID 4a48fe8875c6214145260818 -StartName items/world.txt -ItemCount 3



Name : items/world.txt

Size : 6

UploadTime : 1439083734000

Action : upload

ID : 4_z27c88f1d182b150646ff0b16_f1004ba650fe24e6c_d20150809_m012854_c100_v0009990_t0000



Name : items/how.txt

Size : 6

UploadTime : 1439083734000

Action : upload

ID : 4_z27c88f1d182b150646ff0b16_f8aa4ba650fe24e6c_d20150809_m012854_c100_v0009990_t0000



Name : items/are.txt

Size : 6

UploadTime : 1439083734000

Action : upload

ID : 4_z27c88f1d182b150646ff0b16_f1004hf950fe24e6c_d20150809_m012854_c100_v0009990_t0000



The cmdlet above will start listing the items from items/world.txt and then three preceeding

items after that.











RELATED LINKS

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