For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-PSUVariable

Creates a new variable in PSU.

SYNOPSIS

Creates a new variable in PSU.

SYNTAX

Value (Default)

New-PSUVariable -Name <String> [-Value <Object>] [-Type <String>] [-Description <String>]
 [-DisableRunAsSupport] [-Database] [-Role <String[]>] [-Force] [-Scope <VariableScope>] [-Tag <Tag[]>]
 [-PasswordNotRequired] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

Secret

New-PSUVariable -Name <String> [-Value <Object>] [-InputObject <Object>] -Vault <String> [-Type <String>]
 [-Description <String>] [-DisableRunAsSupport] [-Database] [-Role <String[]>] [-Force]
 [-Scope <VariableScope>] [-Tag <Tag[]>] [-PasswordNotRequired] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

InputObject

DESCRIPTION

Creates a new variable in PSU. Variables are available in all scripts that run within PSU.

EXAMPLES

Example 1

Creates a new variable in PSU named `UserName`. You can use the $UserName variable in all your scripts.

Example 2

Creates a new variable in the vault named `Vault`. The variable's value is not stored in PSU and will only be retrieved when running scripts.

PARAMETERS

-AppToken

An app token to access the PSU API.

-ComputerName

The HTTP address of the PSU REST API server.

-Description

A description for this variable.

-DisableRunAsSupport

Prevents a credential from being used for Run As support.

-InputObject

An input object to store as a variable.

-Integrated

Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.

-Name

The name of the variable. You can reference this in your scripts just as you would with other variables.

-Type

The .NET type of object .

-UseDefaultCredentials

Use default credentials when connecting to the management API

-Value

The value of the variable.

-Vault

The vault to store the variable within.

-Database

Stores the variable value in the database.

-Force

Overwrites existing variables with the same name.

-Role

The roles that can access this variable.

-Credential

Credentials to login to the PowerShell Universal Management API.

-Scope

The variable scope for this variable. Global variable changes will cause resources to restart. Script scoped variables will not.

-Tag

Tags for this variable.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-PasswordNotRequired

Specifies that the password is not required for this variable. This is useful for accounts like Group Managed Service Accounts.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?