# Get-ERPEntitySets Cmdlet to retrieve metadata informations about EntitySets. ## Syntax ```{code-block} powershell :linenos: true Get-ERPEntitySets [[-Service] ] [] ``` ## Parameters | Type | Name | Description | Optional | |--------|---------|-------------------------------------------|----------| | String | Service | Retrieve only EntitySets for this service | yes | ## Return type [EntitySet]() **\[\]** ← on success\ **empty array** ← on failure. Exception/ErrorMessage can be accessed using [\$Error](). ## Remarks When calling the Get-ERPSEntitySets without arguments the EntitySets of all available services are returned. ## Examples In the following examples we are using public OData Services () for demonstration purposes: **Getting all EntitySets** ```{code-block} powershell :linenos: true Get-ERPEntitySets ``` **Get EntitySets from the Service:** ```{code-block} powershell :linenos: true Get-ERPEntitySets -Service "Northwind.svc" ``` **Error handling: Check if an error appeared by using [\$?]() and analyze the [WebRequestException]() to understand why the error occurred, by using \$Error:** ```{code-block} powershell :linenos: true $entitySets = Get-ERPEntitySets -Service "SomeService" if(-not $entitySets){ if($? -eq $false){ $Error[0].Exception #Could not find any service for: 'SomeService' } else{ Write-Host("The Service 'SomeService' does not have any EntitySets!") } } ```