# 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](/code_reference/commandlets/objects/entityset) **\[\]** ← on success\ **empty array** ← on failure. Exception/ErrorMessage can be accessed using [\$Error](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1#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 the 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[\$?](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1#section-1) and analyze the [WebRequestException](/code_reference/net_library/webrequestexception) to understand why the error occurred, by using \$Error:** ```{code-block} powershell :linenos: true $entitySets = Get-ERPEntitySets -Service "SomeService" -ErrorVariable 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!") } } ```