Comments (4)
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adana-popescu, @KalpeshChavan12, @ralucaminea.
from azure-powershell.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adana-popescu, @KalpeshChavan12, @ralucaminea.
from azure-powershell.
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.
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)
- [Feature]: Add Cmdlet(s) for creating and updating Runbook drafts HOT 4
- cmdlets misdocumented and not enough examples HOT 1
- Unable to connect to tenants via GDAP & Az or MG modules in AzAccounts 3.0.0 or later HOT 1
- Get-AzADApplication Does Not Return Results in USGov
- Issue with Invoke-AzOperationalInsightsQuery Returning Incorrect Data Types
- New-AzVM installs BGInfo extension automatically HOT 3
- Which version of Az.ApplicationInsights supports IngestionMode
- [Feature]: Host Azure modules in public ACR in addition to PowerShell Gallery HOT 1
- https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/update-azrecoveryservicesasrprotectiondirection?view=azps-12.1.0&viewFallbackFrom=azps-6.3.0[Doc]: HOT 4
- [Doc] Get-AzSqlServerDisasterRecoveryConfiguration doc no example HOT 2
- Breaking changes with Get-AzAccessToken Token property changed from String to SecureString HOT 3
- [Doc] Set-AzStorageAccountManagementPolicy - Examples not formatted properly in PowerShell HOT 4
- New SharingScope property on Subnets breaks Set-AzVirtualNetwork in older Az.Network versions HOT 2
- [Feature]: Update all HOT 1
- Unable to acquire token for tenant when using AuthScope AzureKeyVaultServiceEndpointResourceId HOT 4
- Start-AzPolicyRemediation (Az.PolicyInsights v1.6.5) Parameter PolicyDefinitionReferenceId Does Not Resolve ResourceId
- Is this feature working?
- Get-AzVMExtensionImage shows useless versions
- Az.Accounts slow import over networked I/O (Azure Functions)
- [Feature]: Add a parameter set to `Get-AzVMImage` that simplifies retrieving popular images and their URN alias, similar to the `az vm image list` command.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-powershell.