azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzureRmAutomationHybridWorkerGroup needs to be updated to reflect new properties

Open jefffanjoy opened this issue 8 years ago • 4 comments

Description

Get-AzureRmAutomationHybridWorkerGroup needs to be updated to reflect new properties that have been added such as last seen timestamp, credential and group type. These properties are all available from the REST API today but are not included in the PowerShell cmdlet results.

Script/Steps for Reproduction

Get-AzureRmAutomationHybridWorkerGroup -ResourceGroupName RGNAME -AutomationAccountName AANAME

Module Version

4.3.2      AzureRM.Automation 

Environment Data

Name                           Value
----                           -----
PSVersion                      5.1.16299.251
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.251
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Debug Output

Relevant part of the debug output showing that these properties are returned by the REST call but some are not being then presented as properties by the cmdlet results (lastSeenDateTime, credential, groupType).

      "id": "/subscriptions/scrubbed/resourceGroups/Testing1/providers/Microsoft.Automation/automationAccounts/scrubbed/hybridRunbookWorkerGroups/TESTHW1",
      "name": "TESTHW1",
      "hybridRunbookWorkers": [
        {
          "name": "TESTHW1",
          "ip": "scrubbed",
          "registrationTime": "2017-10-05T23:32:52.0529779-03:00",
          "lastSeenDateTime": "2018-04-16T00:41:20.8-03:00"
        }
      ],
      "credential": null,
      "groupType": "User"
    },

jefffanjoy avatar Apr 16 '18 03:04 jefffanjoy

@vrdmr Can you take a look at this issue?

maddieclayton avatar Apr 16 '18 23:04 maddieclayton

it is still nearly impossible to retrieve the lastSeenDateTime property with powershell. even the generic Get-AzureRmResource with the correct type, namespace etc. is ignoring the array of workers.

rs38 avatar Nov 19 '18 17:11 rs38

finally I got it working by importing the latest Version 0.6.1 from the Az.Automation module. the same is true for the "old" commandlet with prefix AzureRM and Version 6.13.1: https://www.powershellgallery.com/packages/AzureRM/6.13.1
The missing property thing was already fixed in September https://github.com/Azure/azure-powershell/commit/e098199011c3ad09ef94a0b70f6de76f61bddd12#diff-f3a5751aabbc428aaa014a0c847c2e61

rs38 avatar Nov 28 '18 12:11 rs38

Closing as fixed.

maddieclayton avatar Nov 28 '18 16:11 maddieclayton