Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Export-ODataEndpointProxy

Export-ODataEndpointProxy

microsoft.powershell.odatautils

Synopsis

Generates a module that contains cmdlets to manage an OData endpoint.

Syntax

Export-ODataEndpointProxy [-Uri] [-OutputModule] [-MetadataUri] [-Credential] [-ResourceNameMapping] [-Force] [<CommonParameters>]

Detailed Description

Export-ODataEndpointProxy uses an OData endpoint's metadata to generate a module, based on CDXML, that contains cmdlets you can use to manage an OData endpoint. After generating the module, Export-ODataEndpointProxy saves the module to the path and file name specified by the OutputModule parameter.

Export-ODataEndpointProxy generates cmdlets for create, read, update, and delete (CRUD) operations, non-CRUD actions, and association manipulation.

Export-ODataEndpointProxy generates one CDXML file per endpoint resource. You can edit these CDXML files after the new module is generated (for example, if you need to change the noun or verb names of the cmdlets to align with Windows PowerShell cmdlet naming guidelines. To connect with the endpoint it was generated to manage, every cmdlet in a generated module includes a ConnectionURI parameter.

Parameters

-Credential <PSCredential>

Specifies a user account that has access to the OData endpoint. The default is the current user. This parameter is required, and you are prompted to provide credentials, if a remote computer is running Windows Vista or a later release of the Windows operating system.

Aliases

None

Required?

false

Position

4

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-Force <SwitchParameter>

Forces the cmdlet to overwrite an existing, generated module of the same name in an existing Modules folder.

Aliases

None

Required?

false

Position

6

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-MetadataUri <String>

The URI of the endpoint’s metadata; for example, 'http://services.odata.org/v3/(S(snyruuepthagutkb2yulwldgf1))/odata/odata.svc/$metadata'. For best results, enclose the URI in single quotation marks.

Aliases

None

Required?

false

Position

3

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-OutputModule <String>

Specifies the path and module name to which you want the generated module of proxy commands exported. For example, C:\Users\user\GeneratedScript.psm1.

A binary module, module manifest, and formatting file (if applicable) are copied to the specified folder. If you only specify the name of the module, such as GeneratedScript.psm1, Export-ODataEndpointProxy saves the module in the $home\Documents\WindowsPowerShell\Modules folder by default. If you specify a fully qualified path, the module folder is created in that path.

Aliases

None

Required?

true

Position

2

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-ResourceNameMapping <Hashtable>

Specifies a hashtable that contains mappings that let you customize the generated cmdlets. In this hashtable, you use the resource collection name as the key, with the desired cmdlet noun as the value. For example, -ResourceNameMapping @{Products = 'Merchandise'}, where Products represents the resource collection name that becomes the key, and Merchandise represents the resulting cmdlet noun. The generated cmdlet names might not align to Windows PowerShell cmdlet naming conventions, but you can edit the resource CDXML file to change the cmdlet names after Export-ODataEndpointProxy has created the module.

Aliases

None

Required?

false

Position

5

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-Uri <String>

Specifies the endpoint’s URI; for example, 'http://services.odata.org/v3/(S(snyobsk1hhutkb2yulwldgf1))/odata/odata.svc'. For best results, enclose the URI in single quotation marks.

Aliases

None

Required?

true

Position

1

Default value

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type


Notes

None

Examples

Example 1: Generate a module to manage a retail web service endpoint

This example generates a module to manage a retail service endpoint. The command specifies the endpoint’s URI, and the URI of the endpoint metadata; the command also provides an output path and script module name as the value of the OutputModule parameter. For the value of the ResourceNameMapping parameter, the command provides a hashtable that maps the resource collection name (Products, in this case) with the desired noun for the cmdlet set, Merchandise.

PS C:\>Export-ODataEndpointProxy -Uri 'http://services.odata.org/v3/(S(snyobsk1hhutkb2yulwldgf1))/odata/odata.svc' 
-MetadataUri 'http://services.odata.org/v3/(S(snyobsk1hhutkb2yulwldgf1))/odata/odata.svc/$metadata' -OutputModule C:\Users\user\GeneratedScript.psm1 -ResourceNameMapping @{Products = 'Merchandise'}

Online Version
Creating a Management OData Web Service
OData Library
What is the OData Protocol?
Invoke-RestMethod