< Back

Get-BMEnvironment

Sun Jan 12, 2020 7:01 pm

NAME Get-BMEnvironment



SYNOPSIS

Returns environments from a BuildMaster instance.





SYNTAX

Get-BMEnvironment -Session <Object> [-Force] [<CommonParameters>]



Get-BMEnvironment -Session <Object> -Name <String> [-Force] [<CommonParameters>]





DESCRIPTION

The `Get-BMEnvironment` function gets all the environments from an instance of BuildMaster. By default, this

function returns all active environments. Use the `Force` switch to return inactive environments, too.



To return a specific environment (even one that's inactive), pass its name to the `Name` parameter. If an

environment with the given name doesn't exist, you'll get an error. You can use wildcards to search for active

environments. When searching for an environment with wildcards, inactive environments are not searched. Use the

`Force` switch to include inactive environments in the search.



Pass a session object representing the instance of BuildMaster to use to the `Session` parameter. Use

`New-BMSession` to create a session object.



This function uses BuildMaster's native APIs.





PARAMETERS

-Session <Object>

An object representing the instance of BuildMaster to connect to. Use `New-BMSession` to create session

objects.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

The name of the environment to return. If one doesn't exist, you'll get an error. You may search for

environments by using wildcards. If no environments match the wildcard pattern, no error is returned. When

searching with wildcards, only active environments are searched. Use the `Force` switch to also search

inactive environments.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

By default, inactive/disabled environments are not returned. Use the `Force` to return inactive environments,

too.



Required? false

Position? named

Default value False

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-BMEnvironment



Demonstrates how to return a list of all BuildMaster active environments.









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



PS C:\\>Get-BMEnvironment -Force



Demonstrates how to return a list of all active *and* inactive BuildMaster environments.









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



PS C:\\>Get-BMEnvironment -Name '*Dev*'



Demonstrates how to use wildcards to search for active environments.









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



PS C:\\>Get-BMEnvironment -Name '*Dev*' -Force



Demonstrates how to use wildcards to search for active *and* inactive environments.











RELATED LINKS