![]() |
VOOZH | about |
The CData Cmdlets for ShipStation are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to ShipStation.
The Cmdlets are not only a PowerShell interface to ShipStation, but also an SQL interface; this tutorial shows how to use both to retrieve ShipStation data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for ShipStation. To access ShipStation data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for ShipStation.
Once you have acquired the necessary connection properties, accessing ShipStation data in PowerShell can be enabled in three steps.
Use the BASIC Authentication standard to connect.
Install the module:
Install-Module ShipStationCmdlets
Connect:
$shipstation = Connect-ShipStation -APIKey "$APIKey" -APISecret "$APISecret"
Search for and retrieve data:
$customerid = "1368175" $tags = Select-ShipStation -Connection $shipstation -Table "Tags" -Where "CustomerId = `'$CustomerId`'" $tags
You can also use the Invoke-ShipStation cmdlet to execute SQL commands:
$tags = Invoke-ShipStation -Connection $shipstation -Query 'SELECT * FROM Tags WHERE CustomerId = @CustomerId' -Params @{'@CustomerId'='1368175'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for ShipStation\lib\System.Data.CData.ShipStation.dll")
Connect to ShipStation:
$conn= New-Object System.Data.CData.ShipStation.ShipStationConnection("APIKey='YourAPIKey';APISecret='YourAPISecret'")
$conn.Open()
Instantiate the ShipStationDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Id, Color from Tags"
$da= New-Object System.Data.CData.ShipStation.ShipStationDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.id $_.color
}
Download a free trial of the ShipStation Data Provider to get started:
Download NowLearn more:
👁 ShipStation IconRapidly create and deploy powerful .NET applications that integrate with ShipStation.