< Back

Set-BMVariable

Sun Jan 12, 2020 7:24 pm

NAME Set-BMVariable



SYNOPSIS

Create or set a BuildMaster variable.





SYNTAX

Set-BMVariable -Session <Object> -Name <String> -Value <String> [-WhatIf] [-Confirm] [<CommonParameters>]



Set-BMVariable -Session <Object> -Name <String> -Value <String> -ApplicationName <String> [-WhatIf] [-Confirm]

[<CommonParameters>]



Set-BMVariable -Session <Object> -Name <String> -Value <String> -ApplicationGroupName <String> [-WhatIf]

[-Confirm] [<CommonParameters>]



Set-BMVariable -Session <Object> -Name <String> -Value <String> -EnvironmentName <String> [-WhatIf] [-Confirm]

[<CommonParameters>]



Set-BMVariable -Session <Object> -Name <String> -Value <String> -ServerName <String> [-WhatIf] [-Confirm]

[<CommonParameters>]



Set-BMVariable -Session <Object> -Name <String> -Value <String> -ServerRoleName <String> [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

The `Set-BMVariable` function creates or sets the value of a BuildMaster variable. By default, it creates/sets

global variables. It can also set environment, server, server role, application group, and application variables.



Pass the variable's name to the `Name` parameter. Pass the variable's value to the `Value` parameter. The value is

passed as-is to BuildMaster.



To set an environment's variable, pass the environment's name to the `EnvironmentName` parameter.



To set a server role's variable, pass the server role's name to the `ServerRoleName` parameter.



To set a server's variable, pass the server's name to the `ServerName` parameter.



To set an application group's variable, pass the application group's name to the `ApplicationGroupName` parameter.



To set an application's variable, 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.





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 create.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Value <String>

The variable's value. Passed to BuildMaster as-is.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ApplicationName <String>

The name of the application where the variable should be created. The default is to create a global variable.



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 should be created. The default is to create a global

variable.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EnvironmentName <String>

The name of the environment where the variable should be created. The default is to create a global variable.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ServerName <String>

The name of the server where the variable should be created. The default is to create a global variable.



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 should be created. The default is to create a global variable.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

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:\\>Set-BMVariable -Session $session -Name 'Var' -Value 'Value'



Demonstrates how to create or set a global variable.









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



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



Demonstrates how to create or set a variable in an environment.









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



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



Demonstrates how to create or set a variable for a server role.









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



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



Demonstrates how to create or set a variable for a server.









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



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



Demonstrates how to create or set a variable for an application group.









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



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



Demonstrates how to create or set a variable for an application.











RELATED LINKS