< Back

Get-BMVariable

Sun Jan 12, 2020 7:08 pm

NAME Get-BMVariable



SYNOPSIS

Gets BuildMaster variables.





SYNTAX

Get-BMVariable -Session <Object> [-Name <String>] [-ValueOnly] [<CommonParameters>]



Get-BMVariable -Session <Object> [-Name <String>] -ApplicationName <String> [-ValueOnly] [<CommonParameters>]



Get-BMVariable -Session <Object> [-Name <String>] -ApplicationGroupName <String> [-ValueOnly] [<CommonParameters>]



Get-BMVariable -Session <Object> [-Name <String>] -EnvironmentName <String> [-ValueOnly] [<CommonParameters>]



Get-BMVariable -Session <Object> [-Name <String>] -ServerName <String> [-ValueOnly] [<CommonParameters>]



Get-BMVariable -Session <Object> [-Name <String>] -ServerRoleName <String> [-ValueOnly] [<CommonParameters>]





DESCRIPTION

The `Get-BMVariable` function gets BuildMaster variables. By default, it gets all global variables. It can also

get all variables for a specific environment, server, server role, application group, and application variables.



To get a specific variable, pass the variable's name to the `Name` parameter. The default is to return all

variables for the specific entity you've chosen (the default is global variables).



To get an environment's variables, pass the environment's name to the `EnvironmentName` parameter.



To get a server role's variables, pass the server role's name to the `ServerRoleName` parameter.



To get a server's variables, pass the server's name to the `ServerName` parameter.



To get an application group's variables, pass the application group's name to the `ApplicationGroupName` parameter.



To get an application's variables, pass the application's name to the `ApplicationName` parameter.



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 variables API. Due to a bug in BuildMaster, it uses the native API when reading

application group and application variables.





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 variable to get. The default is to get all global variables.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ApplicationName <String>

The name of the application where the variable or variables should be read. The default is to get global

variables.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ApplicationGroupName <String>

The name of the application group where the variable or variables should be read. The default is to get global

variables.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EnvironmentName <String>

The name of the environment where the variable or variables should be read. The default is to get global

variables.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ServerName <String>

The name of the server where the variable or variables should be read. The default is to get global variables.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ServerRoleName <String>

The name of the server role where the variable or variables should be read. The default is to get global

variables.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ValueOnly [<SwitchParameter>]

Return the variable's value, not an object representing the variable.



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



Demonstrates how to get all global variables.









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



PS C:\\>Get-BMVariable -Session $session -Name 'Var'



Demonstrates how to get a specific global variable.









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



PS C:\\>Get-BMVariable -Session $session -EnvironmentName 'Dev'



Demonstrates how to all an environment's variables.









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



PS C:\\>Get-BMVariable -Session $session -Name 'Var' -EnvironmentName 'Dev'



Demonstrates how to get a specific variable in an environment.









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



PS C:\\>Get-BMVariable -Session $session -ServerRoleName 'WebApp'



Demonstrates how to get all variables in a specific server role.









-------------------------- EXAMPLE 6 --------------------------



PS C:\\>Get-BMVariable -Session $session -Name 'Var' -ServerRoleName 'WebApp'



Demonstrates how to get a specific variable in a server role.









-------------------------- EXAMPLE 7 --------------------------



PS C:\\>Get-BMVariable -Session $session -ServerName 'example.com'



Demonstrates how to get all variables for a specific server.









-------------------------- EXAMPLE 8 --------------------------



PS C:\\>Get-BMVariable -Session $session -Name 'Var' -ServerName 'example.com'



Demonstrates how to get a specific variable in a server.









-------------------------- EXAMPLE 9 --------------------------



PS C:\\>Get-BMVariable -Session $session -ApplicationGroupName 'WebApps'



Demonstrates how to get all variables from a specific application group.









-------------------------- EXAMPLE 10 --------------------------



PS C:\\>Get-BMVariable -Session $session -Name 'Var' -ApplicationGroupName 'WebApps'



Demonstrates how to get a specific variable from an application group.









-------------------------- EXAMPLE 11 --------------------------



PS C:\\>Get-BMVariable -Session $session -ApplicationName 'www'



Demonstrates how to get all variables from a specific application.









-------------------------- EXAMPLE 12 --------------------------



PS C:\\>Get-BMVariable -Session $session -Name 'Var' -ApplicationName 'www'



Demonstrates how to get a specific variable from an application.











RELATED LINKS