Skip to Content
Technical Articles
Author's profile photo Stefan Schnell

Different Behaviour of PowerShell Windows and Core with SAP GUI Scripting

Microsoft PowerShell Core comes more and more in our focus. It is the successor of PowerShell Windows, which is part of Windows 10. The significant visual difference is the major version number, PowerShell Windows 5 and less, PowerShell Core 6 and greater.

During my experiments with PowerShell Core 7 Release Candidate 1, to read an SAP table control with SAP GUI Scripting, I noticed that the property column, from type GuiCollection, delivers in the context of PowerShell 5 an array of COM objects.

But with PowerShell 7 it delivers the expected COM object.

The same SAP GUI Scripting code behaves differently depending on the PowerShell version.
So it is in the cases of GuiCollections necessary to differentiate in your SAP GUI Scripting between the PowerShell versions, e.g. at the columns of a GuiTableControl or at the entries of a GuiCombobox.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.