---
title: "Get-CatDataSource"
description: "Get-CatDataSource — the data sources of the open project, as objects."
url: "https://docs.justcat.it/reference/powershell-module/get-catdatasource/"
---
# Get-CatDataSource

## Synopsis

```powershell
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](https://docs.justcat.it/reference/powershell-module/introduction/ "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

```powershell
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](https://docs.justcat.it/reference/powershell-module/introduction/ "Introduction") — session model, logging, errors, sign-in.
- [Data sources](https://docs.justcat.it/reference/data-sources/ "Data sources") — the properties.
- [`Get-CatDataSourceList`](https://docs.justcat.it/reference/powershell-module/get-catdatasourcelist/ "Get-CatDataSourceList") · [`Show-CatProject`](https://docs.justcat.it/reference/powershell-module/show-catproject/ "Show-CatProject").

