Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Insight

Upload data using Powershell

  • Last UpdatedSep 11, 2023
  • 1 minute read

This example lists the data that is to be uploaded.

$body = "DateTime,Status,TankVolume,Counter

2016-08-01T12:10:50.123Z,Pending,945.6,10

2016-08-01T13:11:12.456Z,Stopped,854.34,15"

Invoke-RestMethod -Uri https://online.wonderware.[DOMAINSUFFIX]/apis/upload/datasource/
-Body $body
-ContentType "text/CSV"
-headers @{"x-filename"="SnacksBox_Dec2016.csv"; "Authorization"="Bearer MY_BEARER_TOKEN"}
-Method Post

This example uploads data from a CSV file (C:\Data\MyFileName.CSV).

Invoke-RestMethod -Uri https://online.wonderware.[DOMAINSUFFIX]/apis/upload/datasource/
-InFile "C:\Data\MyFileName.CSV"
-ContentType "text/CSV"
-headers @{"x-filename"="SnacksBox_Dec2016.csv"; "Authorization"="Bearer MY_BEARER_TOKEN"}
-Method Post

Related Links
TitleResults for “How to create a CRG?”Also Available in