< Back

Get-DbaSsisEnvironmentVariable

Mon Jan 13, 2020 11:41 am

NAME Get-DbaSsisEnvironmentVariable



SYNOPSIS

This command gets specified SSIS Environment and all its variables





SYNTAX

Get-DbaSsisEnvironmentVariable [-SqlInstance] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>

[[-SqlCredential] <Pscredential>] [[-Environment] <System.Object[]>] [[-EnvironmentExclude] <System.Object[]>]

[[-Folder] <System.Object[]>] [[-FolderExclude] <System.Object[]>] [-EnableException <Switch>] [<CommonParameters>]





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





PARAMETERS

-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Environment [<System.Object[]>]

The SSIS Environments names that we want to get variables from



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnvironmentExclude [<System.Object[]>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Folder [<System.Object[]>]

The Folders names that contain the environments



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-FolderExclude [<System.Object[]>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlCredential [<Pscredential>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SqlInstance [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: SSIS, SSISDB, Variable

Author: Bartosz Ratajczyk (@b_ratajczyk)



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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



RELATED LINKS

https://dbatools.io/Get-DbaSsisEnvironmentVariable