BusinessObjects Board

Running Powershell with input parameter

Hello All,

I need to run a powershell script in Data Services and needs to pass the input parameter while calling.


$1= ‘PATB8841’
$headers = New-Object “System.Collections.Generic.Dictionary[[String],[String]]”
$headers.Add(“Content-Type”, “application/xml”)

$body = "
n<customerContractNr>'[$1]'</customerContractNr> n
`n"

$response = Invoke-RestMethod ‘https://k2-bods-api-itg.msit.corp.hpicloud.net/bods/k2-asset-data’ -Method ‘POST’ -Headers $headers -Body $body
$response | ConvertTo-Json


SCRIPT in Data Services
exec(‘rsh’,‘usr/sap/DSD/dataservices/bin/K2RESTAPI.ps1’,8);

Kindly help - how Can i pass this $1 while calling this script - Thanks

Hi. This is pretty straightforward. Please can you advise what difficulty you are facing in doing the same.

Regards.
Shaz