< Back

Remove-BMVariable

Sun Jan 12, 2020 7:23 pm

NAME Remove-BMVariable



SYNOPSIS

Deletes BuildMaster variables.





SYNTAX

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



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

[<CommonParameters>]



Remove-BMVariable -Session <Object> -Name <String> -ApplicationGroupName <String> [-WhatIf] [-Confirm]

[<CommonParameters>]



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

[<CommonParameters>]



Remove-BMVariable -Session <Object> -Name <String> -ServerName <String> [-WhatIf] [-Confirm] [<CommonParameters>]



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

[<CommonParameters>]





DESCRIPTION

The `Remove-BMVariable` function deletes BuildMaster variables. By default, it deletes global variables. It can

also delete variables for a specific environment, server, server role, application group, and application

variables.



Pass the name of the variable to delete to the `Name` parameter. If no variable exists to delete, you'll get an

error.



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



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



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



To delete an application group's variables, pass the application group's name to the `ApplicationGroupName`

parameter.



To delete 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. When deleting application and application group variables, it uses

BuildMaster's native 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 delete.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-ApplicationName <String>

The name of the application where the variable should be deleted. The default is to delete 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 should be deleted. The default is to delete 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 should be deleted. The default is to delete 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 should be deleted. The default is to delete 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 should be deleted. The default is to delete global variables.



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



Demonstrates how to delete a global variable.









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



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



Demonstrates how to delete a variable in an environment.









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



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



Demonstrates how to delete a variable in a server role.









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



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



Demonstrates how to delete a variable in a server.









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



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



Demonstrates how to delete a variable from an application group.









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



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



Demonstrates how to delete a variable from an application.











RELATED LINKS