Set-CmAzContext

Sets the session context for subsequent session runs.

Sets the following in an globally accessible context: * Environment * Project root directory * Build number * Package name * Package version * Build repo name * Build definition name * Build definiton number * Date

This command is part of the common command tooling.

Parameters

-Environment

Required. (String) The environment in which the context is set, e.g prd, dev etc

-ProjectRoot

Required. (String) Where settings and resource files are created.

-ProjectConfirmation

Required. (String) Override for prompt to create a new project root, default is 'y'.

-BuildId

Required. (String) The identifier of the current build.

-BuildRepoName

Required. (String) The repository of the current build.

-BuildDefinitionName

Required. (String) The definition name of the current build.

-BuildDefinitionNumber

Required. (String) The definition number of the current build.

-WhatIf

(Switch) Run the command without executing any actions, so that no changes are made. The command will output a description of actions to be performed against the affected resources in the console window. Use this option if you are unsure of the overall impact of your command and wish to review it before committing to making changes.

-Confirm

(Switch) Run the command without executing any actions, so that no changes are made. The command will output a description of actions to be performed against the affected resources in the console window. Use this option if you are unsure of the overall impact of your command and wish to review it before committing to making changes.

Examples

Example 1

1
2
3
    Set-CmAzContext -ProjectRoot "C:/MyProject"
    
  

Example 2

1
2
3
4
5
6
7
8
9
10
    Set-CmAzContext  `
	-Environment "Development"
	-ProjectRoot "C:/MyProject"
	-ProjectConfirmation "y"
	-BuildId "0.0.2"
	-BuildRepoName "MyRepoName"
	-BuildDefinitionName "Manual"
	-BuildDefinitionNumber "1.0"