Get to Lines object in PowerShell

SOLVED

Hi Experts,

am working on a data import into Sage 100 in PowerShell through BOI. It works fine. The one problem I have is to get to Lines Objects.

In VBScript i used the following line to get a handle for the oLines object:

Set oLines = oSession.AsObject(oHeader.Lines)

Does anyone know how that would look like in PowerShell. I have $oSS as the SY_Session Object and I have $oAPInv as the Invoice Object (AP_Invoice_Bus).

I am able to log into Sage, create my Invoice Batch, work through the Invoice Header, but now I need to deal with the lines.

Thanks for your help!