Get-ERPEntitySets

Cmdlet to retrieve metadata informations about EntitySets.

Syntax

1
Get-ERPEntitySets [[-Service] <String>] [<CommonParameters>]

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 (http://services.odata.org) for demonstration purposes:

Getting all EntitySets

1
Get-ERPEntitySets

Get EntitySets from the Service:

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

1
2
3
4
5
6
7
8
9
$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!")
        }
}