Set-SmaVariable

Applies To: System Center 2012 R2 Orchestrator, Windows Azure Pack for Windows Server

Set-SmaVariable

Creates or modifies a variable in Service Management Automation.

Syntax

Parameter Set: Default
Set-SmaVariable -Name <String> -Value <Object> -WebServiceEndpoint <String> [-AuthenticationType <String> ] [-Credential <PSCredential> ] [-Description <String> ] [-Encrypted] [-Force] [-Port <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Set-SmaVariable cmdlet creates or modifies a variable in Service Management Automation. Specify the name of the variable and a value.

To encrypt the variable, use the Encrypted parameter. You cannot modify the encrypted state of a variable after creation. Using the Encrypted parameter on an existing, non-encrypted, variable fails.

Parameters

-AuthenticationType<String>

Specifies the authentication type. Valid values are: Basic, Windows.

Windows is the default value. If you use Basic authentication, you must provide credentials by using the Credential parameter.

Aliases

none

Required?

false

Position?

named

Default Value

Windows

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies user credentials, as a PSCredential object, to use for the connection to the Service Management Automation web service. To obtain a credential object, use the Get-Credential cmdlet. For more information, type Get-Help Get-Credential.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

Provides a description for the variable.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Encrypted

Indicates that the variable should be encrypted.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Modifies the variable without prompting you for confirmation. The cmdlet prompts you for confirmation before it proceeds if you provide a SecureString as the value for the Value parameter, or if the value contains an object with SecureString as a field and you do not use the Encrypted parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a variable.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Port<Int32>

Specifies the port number of the Service Management Automation web service.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Value<Object>

Specifies a value for the variable.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WebServiceEndpoint<String>

Specifies the endpoint, as a URL, of the Service Management Automation web service. Include the protocol, for example, http:// or https://.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

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, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Assign a value to a variable

This command assigns the value String07 to the variable named Variable01 for the specified web service endpoint. Because the command specifies the Encrypted parameter, it encrypts the variable.

PS C:\> Set-SmaVariable -Name "Variable01" -Value "String07" -WebServiceEndpoint "https://contoso.com/app01" -Encrypted

Get-SmaVariable

Remove-SmaVariable