Code Monkey home page Code Monkey logo

Comments (4)

microsoft-github-policy-service avatar microsoft-github-policy-service commented on August 17, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adana-popescu, @KalpeshChavan12, @ralucaminea.

from azure-powershell.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on August 17, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adana-popescu, @KalpeshChavan12, @ralucaminea.

from azure-powershell.

theheatDK avatar theheatDK commented on August 17, 2024

Hi,
I found the problem. If I call Get-AzMaintenanceConfiguration with an ResourceGroupName parameter it works, if I don't it fails.

Without the ResourceGroupName parameter is returns a List`1 and with a ResourceGroupName parameter is returns a PSMaintenanceConfiguration.

PS C:\> $MaintenanceConfig = Get-AzMaintenanceConfiguration -name 'aum-pelo01'
PS C:\> $MaintenanceConfig.gettype()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     List`1                                   System.Object

PS C:\> $MaintenanceConfig.count
1
PS C:\> Update-AzMaintenanceConfiguration -ResourceGroupName 'pelo-test' -Name 'aum-pelo01' -Configuration $MaintenanceConfig
Update-AzMaintenanceConfiguration: Cannot convert 'Microsoft.Azure.Commands.Maintenance.Models.PSMaintenanceConfiguration' to the type 'Microsoft.Azure.Commands.Maintenance.Models.PSMaintenanceConfiguration' required by parameter 'Configuration'. Specified method is not supported.
PS C:\>
PS C:\> $MaintenanceConfig = Get-AzMaintenanceConfiguration -name 'aum-pelo01' -ResourceGroupName 'pelo-test'
PS C:\> $MaintenanceConfig.gettype()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    PSMaintenanceConfiguration               System.Object

PS C:\> $MaintenanceConfig.count
1
PS C:\> Update-AzMaintenanceConfiguration -ResourceGroupName 'pelo-test' -Name 'aum-pelo01' -Configuration $MaintenanceConfig


Location                               : eastus2
Tags                                   : {"ContactPerson":"PELO","CostCenter":"11096040","MacoTask":"Nfrst"}
ExtensionProperties                    : {"InGuestPatchMode":"User"}
MaintenanceScope                       : InGuestPatch
Id                                     : /subscriptions/45fcd6a2-c6ba-4a15-b6ba-fcb3c93978aa/resourcegroups/pelo-test/providers/microsoft.maintenance/maintenanceconfigurations/aum-pelo
01
Name                                   : aum-pelo01
Type                                   : Microsoft.Maintenance/maintenanceConfigurations
StartDateTime                          : 2024-06-26 00:00
Duration                               : 03:55
Timezone                               : Romance Standard Time
Visibility                             : Custom
RecurEvery                             : 1Day
LinuxParameterClassificationToInclude  : System.Collections.Generic.HashSet`1[System.String]
LinuxParameterPackageNameMaskToExclude : System.Collections.Generic.HashSet`1[System.String]
LinuxParameterPackageNameMaskToInclude : System.Collections.Generic.HashSet`1[System.String]
WindowParameterKbNumberToInclude       : System.Collections.Generic.HashSet`1[System.String]
WindowParameterKbNumberToExclude       : System.Collections.Generic.HashSet`1[System.String]
WindowParameterClassificationToInclude : System.Collections.Generic.HashSet`1[System.String]
InstallPatchRebootSetting              : IfRequired```

from azure-powershell.

isra-fel avatar isra-fel commented on August 17, 2024

That's probably it - source code

When there's no RG name the command lists all configurations, filter them, then put the results in a List then output. The solution is to call WriteObject() multiple times, each time writing a configuration object, or to use the other overload WriteObject (object sendToPipeline, bool enumerateCollection) to enumerate the list automatically.

from azure-powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.