Get-CatDataSource
Returns the data sources of the open project — name, provider, connection string — as objects.
On this page
Synopsis
Get-CatDataSource
Parameters
None (common parameters only).
What it does
Reads the data sources CAT loaded when the project was opened — from the project file and from every data-source list the project points to — and writes them to the pipeline. Nothing is connected; this is what the project defines.
Output
One List<DataSourceDefinition> object (assign it, or wrap the call in parentheses, to work with the items — see Introduction). Each item has Name, ProviderTypeAndVersion (for example SqlServer@2), ConnectionString (with environment variables already expanded), Settings, and DataSourceListID — the list it came from. The *Raw twins hold the values as written in the file.
Errors
There is no CAT project open. Use Open-CatProject to open it. when nothing is open.
Examples
Open-CatProject
(Get-CatDataSource) | Select-Object Name, ProviderTypeAndVersion
# which data sources use a Windows-only provider?
$ds = Get-CatDataSource
$ds | Where-Object ProviderTypeAndVersion -like 'Dax@*'
Related
- Introduction — session model, logging, errors, sign-in.
- Data sources — the properties.
Get-CatDataSourceList·Show-CatProject.