PowerShell
PreviousNext


$conn = new-object System.Data.Odbc.OdbcConnection
 
#$conn.connectionstring = "DSN=MyDSNName"
#or use direct connection string
$conn.connectionstring = "Driver={ZappySys JSON Driver}"
 
$conn.open()
$sql="SELECT * FROM value ORDER BY Country WITH (SRC='http://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json')"
$cmd = New-object System.Data.Odbc.OdbcCommand($sql,$conn)
$dataset = New-Object System.Data.DataSet
(New-Object System.Data.Odbc.OdbcDataAdapter($cmd)).Fill($dataSet) | Out- Null
$conn.Close()

Articles

Click here to see all articles for [PowerShell] category
Call REST API in PowerShell Script – Export JSON to CSV

Call REST API in PowerShell Script – Export JSON to CSV

Introduction In this article we will cover how to call REST API in PowerShell and export result to CSV file. If you want to export JSON based API result to file then you have to consider few things. Such as API Authentication, API Pagination, Parsing JSON, Error Handling and many more. Luckily we can use […]



Copyrights reserved. ZappySys LLC.