Skip to Content

Hello community,

a month ago I wrote here about the possibility to get data from SAP NW gateway interface with OData via VBScript. Here now an equivalent solution for PowerShell.


  $User = "MyUser"
  $Password = Read-Host -Prompt "Passwort" -AsSecureString
  $Cred = New-Object System.Management.Automation.PSCredential($User, $Password)

  $RequestURI = "$format=xml" 
  $Records = Invoke-RestMethod -Uri $RequestURI -Credential $Cred -Method Get

  ForEach($Record in $Records) {
    $Properties = $Record.Content.Properties
    Write-Host $Properties.LastName $Properties.ForeName


With PowerShell it is absolut easy to get access to the XML object hierarchy.

Enjoy it.


To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply