Object Structure
- Last Updated: May 14, 2025
- 3 minute read
- LoadMaster
- LoadMaster GA
- Documentation
Before version 7.2.39.0.334 of the Progress Kemp PowerShell wrapper, the output format did not have a defined standard - each commandlet had variable structure and output.
In the 7.2.39.0.344 version of the wrapper, improvements were made to the output structure. All commands (except Test-LmServerConnection) return a PowerShell object with the following structure:
-
ReturnCode (integer)
-
Response (string)
-
Data (PowerShell object, if any)
The possible values for the ReturnCode field are:
-
200: The command completed successfully
-
4xx/500: The command ended with an error. The error code depends on the error type.
The possible values for the Response field are:
-
Command successfully executed
-
Description of the error when the command fails, for example Unknown parameter value lmversion.
The Data field contains the response, if any. The structure of this field depends on the command. The elements of this field can be accessed by assigning the command to a variable and using the “dot” notation (for example, $lm_Version.Data.version in the example below). The next argument is listed by PowerShell after you enter the dot, for example, Data, Response, or ReturnCode, depending on the data in the variable. The dot can be used multiple times to focus on certain information, for example, $lm_Version.Data.version.Length. If the command fails, this field is empty.
Example 1: Retrieve the installed LoadMaster firmware version:
$lma = Get-LmParameter -Param version -LoadBalancer 172.21.59.189 -SubjectCN user1$lma | Format-ListReturnCode : 200Response : Command successfully executed.Data : @{version=7.2.59.0.21866.DEV}
$lm_Version.Data.version7.2.59.0.21866.DEVExample 2: Retrieve the available licenses for a specific Order ID:
$licDet = Get-LicenseType -KempId jbloggs@kemptechnologies.com -Password ExamplePassword -LoadBalancer 172.21.59.85 -Credential bal -OrderId Example20170517$licDet | Format-ListReturnCode : 200Response : Command successfully executed.Data : @{License=System.Object[]} $licDet.Data.Licenseid : 0632b88b577c71591798268bcd4e01132f082309name : VLM-5000 ESP GEO with Basic 2 Yearsavailable : 1description : VLM-5000 ESP GEO with Basic 2 Yearstethered : FalseLicenseStatus : Permanent LicenseBuyMoreAt : https://www.kemptechnologies.com/buy-me-now?KempID= jbloggs@kemptechnologies.comid : fc488d991cffb7a5958625427d6bfb0b3edc008ename : VLM-5000 WAF GEO with Basic 3 Yearsavailable : 1description : VLM-5000 WAF GEO with Basic 3 Yearstethered : FalseLicenseStatus : Permanent LicenseBuyMoreAt : https://www.kemptechnologies.com/buy-me-now?KempID= jbloggs@kemptechnologies.comname : VLM-5000 with Enterprise Plus subscriptionavailable : 1tethered : 0id : 3eb92178611573946b422cf8d0df69d04c07fedeLicenseStatus : Temp Licensedescription : VLM-5000 with Enterprise Plus subscriptionBuyMoreAt : https://www.kemptechnologies.com/buy-me-now?KempID= jbloggs@kemptechnologies.comIn the above example, the $licDet.Data.License is an array and each single element of the array can be accessed using the “[]” notation. For example, to access the field name of the second element of the previous array we have to use the following notation: $licDet.Data.License[1].name. The index of the array starts from 0. The NULL object is returned if we try to access a non-existing element.
The benefits of the structure of the command answers are:
-
It is easy to check for success/error (ReturnCode)
-
There is a short description (Response)
-
The Data field returns a PowerShell object when successful and null when there is an error