Variables
  • 07 Nov 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Variables

  • Dark
    Light
  • PDF

Article summary

Get-LiquitVariable

Synopsis

This command displays a list of all the variables available within Liquit Workspace. Alternatively, you can select a specific variable.
See Variables for a complete list of all predefined variables within Liquit Workspace.

Syntax

 Get-LiquitVariable 
    [[-ID] <string[]>] 
    [-Inherited] 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

 Get-LiquitVariable 
    [-Context] <Context> 
    [[-ID] <string[]>] 
    [-Inherited] 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

 Get-LiquitVariable 
    [-Snapshot] <PackageSnapshot> 
    [[-ID] <string[]>] 
    [-Inherited] 
    [-LiquitContext <LiquitContext>]  
    [<CommonParameters>]

Examples

Example 1: Get-LiquitVariable

 Get-LiquitVariable 

This command displays all variables defined within Liquit Workspace.

Example 2: Get-LiquitVariable

Get-LiquitVariable -ID 00000000-0000-0000-0000-000000000000

This command displays the selected variable.

New-LiquitVariable

Synopsis

This command creates or updates an existing variable (in a zone, context or package snapshot). This cmdlet has the same behaviour as Set-LiquitVariable.

Syntax

New-LiquitVariable 
    [-ID] <string[]> 
    [-Value] <string>
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

New-LiquitVariable 
    [-Variable] <Variable[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

New-LiquitVariable 
    [-Snapshot] <PackageSnapshot[]> 
    [-ID] <string[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm] 
    [<CommonParameters>]

New-LiquitVariable 
    [-Context] <Context[]> 
    [-ID] <string[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Example

 New-LiquitVariable -ID "PowerShell Variable" -Value "PowerShell Value"

This command creates a new variable with the id "PowerShell Variable" and the value "PowerShell Value".

Parameters

NameValueDescriptionRequiredDefault value
ID<string[]>The ID the variable should have.New variables
SensitiveA switch parameter you can use to set the variable as sensitive case.
Value<string>The value of the variable.No
Variable<Variable[]>The variable you want to edit.Existing variables
Snapshot<PackageSnapshot[]>The snapshot to which you want to assign the variable.Snapshot only
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

Set-LiquitVariable

Synopsis

This command lets you edit the properties of a variable.

Syntax

Set-LiquitVariable 
    [-ID] <string[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Set-LiquitVariable 
    [-Variable] <Variable[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Set-LiquitVariable 
    [-Snapshot] <PackageSnapshot[]> 
    [-ID] <string[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm] 
    [<CommonParameters>]

Set-LiquitVariable 
    [-Context] <Context[]> 
    [-ID] <string[]> 
    [-Value] <string> 
    [[-Sensitive]]
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Example

 Set-LiquitVariable -ID "PowerShell Variable" -Value "PowerShell Value"

This command creates a new variable with the id “PowerShell Variable” and the value “PowerShell Value”.

Parameters

NameValueDescriptionRequiredDefault value
ID<string[]>The ID the variable should have.New variables
Value<string>The value of the variable.No
Variable<Variable[]>The variable you want to edit.Existing variables
Snapshot<PackageSnapshot[]>The snapshot to which you want to assign the variable.Snapshot only
SensitiveA switch parameter you can use to set the variable as sensitive case.
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

Clear-LiquitVariable

Synopsis

This command clears a variable.

Syntax

Clear-LiquitVariable 
    [-ID] <string[]> 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Clear-LiquitVariable 
    [-Variable] <Variable[]> 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Clear-LiquitVariable 
    [-Snapshot] <PackageSnapshot[]> 
    [-ID] <string[]> 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Clear-LiquitVariable 
    [-Context] <Context[]> 
    [-ID] <string[]> 
    [-LiquitContext <LiquitContext>] 
    [-WhatIf] 
    [-Confirm]  
    [<CommonParameters>]

Example

 $variable  = Get-LiquitVariable -ID "PowerShell Variable"
 Clear-LiquitVariable -Variable  $variable  

This command removes the selected variable.

Parameters

NameValueDescriptionRequiredDefault value
ID<string[]>The ID of the variable you want to remove.Id and snapshot
Variable<Variable[]>The variable you want to remove.Variable only
Snapshot<PackageSnapshot[]>The snapshot containing the variable you want to remove.Snapshot only
Context<Context[]>The context containing the variable you want to remove.Context only
LiquitContext<LiquitContext>Determines the selected zone.NoDefault

Was this article helpful?

What's Next