commands

^

Get-DbaSsisEnvironmentVariable

Author Bartosz Ratajczyk (@b_ratajczyk)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbaSsisEnvironmentVariable on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaSsisEnvironmentVariable.

Synopsis

This command gets specified SSIS Environment and all its variables

Description

This command gets all variables from specified environment from SSIS Catalog. All sensitive values are decrypted. The function communicates directly with SSISDB database, "SQL Server Integration Services" service isn't queried there. Each parameter (besides SqlInstance and SqlCredential) acts as the filter to only include or exclude particular element

Syntax

Get-DbaSsisEnvironmentVariable
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Environment] <Object[]>]
    [[-EnvironmentExclude] <Object[]>]
    [[-Folder] <Object[]>]
    [[-FolderExclude] <Object[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV -Folder DWH_ETL

Gets variables of 'DEV' environment located in 'DWH_ETL' folder on 'localhost' Server

Example: 2
PS C:\> Get-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV -Folder DWH_ETL, DEV2, QA

Gets variables of 'DEV' environment(s) located in folders 'DWH_ETL', 'DEV2' and 'QA' on 'localhost' server

Example: 3
PS C:\> Get-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV -FolderExclude DWH_ETL, DEV2, QA

Gets variables of 'DEV' environments located in folders other than 'DWH_ETL', 'DEV2' and 'QA' on 'localhost' server

Example: 4
PS C:\> Get-DbaSsisEnvironmentVariable -SqlInstance localhost -Environment DEV, PROD -Folder DWH_ETL, DEV2, QA

Gets variables of 'DEV' and 'PROD' environment(s) located in folders 'DWH_ETL', 'DEV2' and 'QA' on 'localhost' server

Example: 5
PS C:\> Get-DbaSsisEnvironmentVariable -SqlInstance localhost -EnvironmentExclude DEV, PROD -Folder DWH_ETL, DEV2, QA

Gets variables of environments other than 'DEV' and 'PROD' located in folders 'DWH_ETL', 'DEV2' and 'QA' on 'localhost' server

Example: 6
PS C:\> Get-DbaSsisEnvironmentVariable -SqlInstance localhost -EnvironmentExclude DEV, PROD -FolderExclude DWH_ETL, DEV2, QA

Gets variables of environments other than 'DEV' and 'PROD' located in folders other than 'DWH_ETL', 'DEV2' and 'QA' on 'localhost' server

Example: 7
PS C:\> 'localhost' | Get-DbaSsisEnvironmentVariable -EnvironmentExclude DEV, PROD

Gets all SSIS environments except 'DEV' and 'PROD' from 'localhost' server. The server name comes from pipeline

Example: 8
PS C:\> 'SRV1', 'SRV3' | Get-DbaSsisEnvironmentVariable

Gets all SSIS environments from 'SRV1' and 'SRV3' servers. The server's names come from pipeline

Example: 9
PS C:\> 'SRV1', 'SRV2' | Get-DbaSsisEnvironmentVariable DEV | Out-GridView

Gets all variables from 'DEV' Environment(s) on servers 'SRV1' and 'SRV2' and outputs it as the GridView.
The server names come from the pipeline.

Example: 10
PS C:\> 'localhost' | Get-DbaSsisEnvironmentVariable -EnvironmentExclude DEV, PROD | Select-Object -Property Name, Value | Where-Object {$_.Name -match '^a'} | Out-GridView

Gets all variables from Environments other than 'DEV' and 'PROD' on 'localhost' server,
selects Name and Value properties for variables that names start with letter 'a' and outputs it as the GridView

Required Parameters

-SqlInstance

The target SQL Server instance or instances. This can be a collection and receive pipeline input to allow the function to be executed against multiple SQL Server instances.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential). Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported. For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Environment

The SSIS Environments names that we want to get variables from

Alias
Required False
Pipeline false
Default Value
-EnvironmentExclude

The SSIS Environments to exclude. Acts as a filter for environments, best used without 'Environment' parameter to get variables for all environments but excluded ones

Alias
Required False
Pipeline false
Default Value
-Folder

The Folders names that contain the environments

Alias
Required False
Pipeline false
Default Value
-FolderExclude

The Folders names to exclude. Acts as a filter for folders containing environments, best user without 'Folder' parameter to get variables for all folders but excluded ones

Alias
Required False
Pipeline false
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False