I have problems running a PowerShell CmdLets to get Azure Automation Node Configurations
Cmdlets:
Get-AzureRmAutomationDscNodeConfiguration -ResourceGroupName "ResourceGroup03" -AutomationAccountName "Contoso17" -ConfigurationName "config"
Like Example 2 in https://learn.microsoft.com/en-us/powershell/module/azurerm.automation/get-azurermautomationdscnodeconfiguration?view=azurermps-6.13.0#examples
If i run the cmdlets like Exampe 3 it works with no errors.
The error:
Get-AzureRmAutomationDscNodeConfiguration : There is an unterminated
literal at position 40 in 'properties/configuration/name eq config''.
At line:1 char:1
+ Get-AzureRmAutomationDscNodeConfiguration -ResourceGroupName $rg -
Aut ...
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-
AzureRmAuto...deConfiguration], ErrorResponseException
+ FullyQualifiedErrorId:
Microsoft.Azure.Commands.Automation.Cmdlet.GetAzureAutomationDscNodeConfiguration
If i run the cmdlet without "-ConfigurationName "config" I get no error.
Get-AzureRmAutomationDscNodeConfiguration -ResourceGroupName "ResourceGroup03" -AutomationAccountName "Contoso17"
The output of this cmdlet shows ConfigurationName "config".
ResourceGroupName : XXX
AutomationAccountName : XXX
Name : config.TestNode
CreationTime : 10.03.2019 14.10.44 +01:00
LastModifiedTime : 10.03.2019 14.10.44 +01:00
ConfigurationName : config
RollupStatus : Good
Any idea?
Welcome to Stack Overflow! :)
Good find! I was also able to reproduce it so I have reported this -> https://github.com/Azure/azure-powershell/issues/8738 issue with the concerned Microsoft Azure team.
Note that I have reported the above mentioned issue by referencing to PowerShell Az module cmdlet but not PowerShell AzureRm module cmdlet because as per this -> https://learn.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-1.4.0 Microsoft article it is recommended to upgrade to Az module from AzureRm module.
For more process related information, please refer below links.
https://github.com/Azure/azure-powershell#reporting-issues-and-feedback
https://github.com/Azure/azure-powershell/issues/new/choose
Meanwhile, as a workaround to accomplish your requirement of getting metadata for DSC node configurations in Automation by specifying the name of DSC configuration for which the cmdlet gets node configuration metadata, you may just use below command.
For PowerShell Az module:
Get-AzAutomationDscNodeConfiguration -ResourceGroupName "ResourceGroup03" -AutomationAccountName "Contoso17" | ?{$_.ConfigurationName -eq "config"}
For PowerShell AzureRm module:
Get-AzureRmAutomationDscNodeConfiguration -ResourceGroupName "ResourceGroup03" -AutomationAccountName "Contoso17" | ?{$_.ConfigurationName -eq "config"}
Hope this helps!! Cheers!! :)