< Back

Get-CBResourceService

Mon Jan 13, 2020 3:25 am

NAME Get-CBResourceService



SYNOPSIS

Gets service resources from CloudBolt.





SYNTAX

Get-CBResourceService -Session <Object> [-PageSize <Int32>] [<CommonParameters>]



Get-CBResourceService -Session <Object> -ID <Int32> [<CommonParameters>]





DESCRIPTION

The `Get-CBResourceService` function gets service resources from CloudBolt. Pass the session for the target

CloudBolt instance to the `Session` parameter (use `New-CBSession` to create a session). All service resources are

returned. CloudBolt pages result sets, and the `Get-CBResourceService` function makes one request per page of

results. You can control how many environments to include in each page with the `PageSize` parameter. The default

is 100, CloudBolt's maximum page size. When getting all services, CloudBolt only returns each service's name and

ID.



`Get-CBResourceService` can also return a specific service. Pass its ID to the `ID` parameter. You can also pipe

service objects (any object with an `ID` property) or IDs to `Get-CBResourceService`. When getting a specific

service, CloudBolt returns all information about the service.





PARAMETERS

-Session <Object>

The session to the CloudBolt instance to connect to and use.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ID <Int32>

The ID of the service resource to get.



Required? true

Position? named

Default value 0

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-PageSize <Int32>

The page size. CloudBolt pages all lists of objects. The `Get-CBResourceService` function will make an HTTP

request for every page of results so that all service resources get returned. The default page size is 100,

CloudBolt's maximum allowed page size.



Required? false

Position? named

Default value $defaultPageSize

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



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



PS C:\\>Get-CBResourceService -Session $session



Demonstrates how to get all service resources from CloudBolt. When getting all services, CloudBolt only returns

each service's ID and name.









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



PS C:\\>Get-CBResourceService -Session $session -PageSize 25



Demonstrates how to change the number of results per page/request to the CloudBolt API. The larger the number, the

greater the strain on CloudBolt but the fewer requests will be made. The default is 100, CloudBolt's maximum

allowed page size.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-CBResourceService -Session $session -ID 1



Demonstrates how to get a specific service resource from CloudBolt.









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>$environments | Get-CBResourceService -Session $session



Demonstrates that you can pipe environment objects to `Get-CBResourceService`. Each object must have an `ID`

property.









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>@( 1, 2, 3) | Get-CBResourceService -Session $session



Demonstrates that you can pipe IDS to `Get-CBResourceService`.











RELATED LINKS