Get an OData Connection

Scenario/Problem: You need to create an OData Connection settings object for use in other cmdlets.

Solution: Use the Get-SPODataConnectionSetting cmdlet.

The Get-SPODataConnectionSetting cmdlet enables you to retrieve OData connection settings. Provide the name of the connection and service context to identity the specific connection. Use a variable to store the settings, as shown in Listing 15.10. You can then use the variable in other cmdlets (see the next section for an example).

Listing 15.10. Getting a Specific OData Connection for BCS

$odata = Get-SPODataConnectionSetting -Name "PhillyBikeNetwork"-ServiceContext "http://sp2013"

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.