Azure / Azure/azure-powershell

Invoke-AzVMInstallPatch -ClassificationToIncludeForWindows 'Updates' returns 'the value '15' of parameter' error message

Open
#28,792 3 comments 1 reaction 0 assignees View on GitHub
act-observability-squad bug Compute - VM customer-reported Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

trying to update using 'Updates' keyword fails, but if i use a list it works

WORKS:
```
Invoke-AzVMInstallPatch -ResourceGroupName some-rg -VMName some-vm -Windows -RebootSetting "Always" -MaximumDuration PT2H -ClassificationToIncludeForWindows @('Critical,Definition,FeaturePack,Security,ServicePack,Tools,UpdateRollUp,Updates' -split ",")
```

### Issue script & Debug output

```PowerShell
$p = Invoke-AzVMInstallPatch -ResourceGroupName MYVMRG -VMName my-vm -Windows -RebootSetting "Always" -MaximumDuration PT2H -ClassificationToIncludeForWindows 'Critical,Security,FeaturePack,Definition,UpdateRollUp,Tools,Updates'
Invoke-AzVMInstallPatch: The value '15' of parameter 'windowsParameters.classificationsToInclude' is not allowed. Allowed values are: Unknown, Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates.
ErrorCode: InvalidParameter
ErrorMessage: The value '15' of parameter 'windowsParameters.classificationsToInclude' is not allowed. Allowed values are: Unknown, Critical, Security, UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates.
ErrorTarget: windowsParameters.classificationsToInclude
StatusCode: 400
ReasonPhrase:
OperationID :
```

### Environment data

```PowerShell
> $PSVersionTable

Name Value
---- -----
PSVersion 7.4.12
PSEdition Core
GitCommitId 7.4.12
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
> Get-Module Az*

ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 5.2.0 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script 10.2.0 Az.Compute {Add-AzGalleryInVMAccessControlProfileVersionRulesIdentity, Add-AzGalleryInVMAccessControlProfileVer…
```

### Error output

```PowerShell
Message : The value '15' of parameter 'windowsParameters.classificationsToInclude' is not allowed. Allowed values are: Unknown, Critical, Security, UpdateRollup,
FeaturePack, ServicePack, Definition, Tools, Updates.
ErrorCode: InvalidParameter
ErrorMessage: The value '15' of parameter 'windowsParameters.classificationsToInclude' is not allowed. Allowed values are: Unknown, Critical, Security,
UpdateRollup, FeaturePack, ServicePack, Definition, Tools, Updates.
ErrorTarget: windowsParameters.classificationsToInclude
StatusCode: 400
ReasonPhrase:
OperationID : ___SOME__ID___
ServerMessage :
ServerResponse :
RequestMessage :
InvocationInfo : {Invoke-AzVMInstallPatch}
Line : Invoke-AzVMInstallPatch -ResourceGroupName some-rg -VMName some-vm -Windows -RebootSetting "Always"
-MaximumDuration PT2H -ClassificationToIncludeForWindows 'Critical,Definition,FeaturePack,Security,ServicePack,Tools,UpdateRollUp,Updates'
Position : At line:1 char:1
+ Invoke-AzVMInstallPatch -ResourceGroupName some-rg…
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StackTrace : at Microsoft.Azure.Commands.Compute.ComputeClientBaseCmdlet.ExecuteClientAction(Action action)
at Microsoft.Azure.Commands.Compute.Automation.InvokeAzureVMInstallPatch.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T](T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
HistoryId : 1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.