Calling "PSDesiredStateConfiguration/WindowsOptionalFeature" Fails with Error
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- powershell, yaml
- Ambito
- devops
Direzione di ricerca
Inizia riproducendo il problema con test.config.dsc.yaml e il comando dsc.exe config get fornito. Traccia l’errore a partire da ResourceProviderAdapter.GetPSObjectArrayValue nello stack trace riportato e confronta l’input della risorsa WindowsOptionalFeature con l’errore di cast registrato. Il lavoro è completo quando la configurazione restituisce un risultato invece dell’errore riportato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Summary
I have been experimenting with DSC and have encountered an Error with what i belive is the "PSDesiredStateConfiguration/WindowsOptionalFeature" resource when using the attached document
I continuously encountered the following error:
NativeErrorCode : Failed
ErrorData : MSFT_WmiError
MessageId : MI RESULT 1
ErrorSource :
ErrorType : 0
StatusCode : 1
Message : A general error occurred that is not covered by a more specific error code.
Data : {}
InnerException :
TargetSite : Void ProcessNativeCallback(Microsoft.Management.Infrastructure.Native.OperationCallbackProcessingContext, T, Boolean, Microsoft.Management.Infrastructure.Native.MiResult,
System.String, Microsoft.Management.Infrastructure.Native.InstanceHandle)
StackTrace : at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext,
T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)
HelpLink :
Source : Microsoft.Management.Infrastructure
HResult : -2146233088
When investigation dsc logs i have managed to identity this event
Job {DE97456C-C6CA-11F0-811C-010101010000} :
Message Unable to cast object of type 'System.Management.Automation.PSObject' to type 'System.Object[]'.
HResult -2147467262
StackTrack at System.Management.Automation.LanguagePrimitives.ConvertTo[T](Object valueToConvert)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.GetPSObjectArrayValue(CimType cimType, Object propertyValue)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.GetTargetResource(IntPtr resourceConfigurationInstanceHandle, IntPtr nonResourcePropetiesHandle, IntPtr metaConfigHandle, IntPtr regInstanceHandle, IStreamHandler plugInStreamsHandler, IntPtr& outputInstanceHandle, IntPtr& errorInstanceHandle)
at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscPluginManagedEntryWrapper.Get(IntPtr provContext, IntPtr instance, IntPtr nonResourcePropeties, IntPtr metaConfig, IntPtr regInstance, IntPtr outputInstance, IntPtr extendedError)
followed by this one which i believe to be the cause of the issue
Job {DE97456C-C6CA-11F0-811C-010101010000} :
MIResult: 1
Error Message: NULL
Message ID: NULL
Error Category: 0
Error Code: 0
Error Type: NULL
Steps to reproduce
- use the following config file
$schema: https://aka.ms/dsc/schemas/v3.0.0/config/document.json
resources:
- name: "Enable HyperV"
type: Microsoft.Windows/WindowsPowerShell
properties:
resources:
- name: "Enable HyperV"
type: "PSDesiredStateConfiguration/WindowsOptionalFeature"
properties:
Name: "Microsoft-Hyper-V-All"
-
Execute the following command line with the saved config file
dsc.exe config get --file "F:\Homelab_DSC\test.config.dsc.yaml" -o yaml
Expected behavior
i expect to get an actual result not an Error
Actual behavior
returns Error Message
Error details
NativeErrorCode : Failed
ErrorData : MSFT_WmiError
MessageId : MI RESULT 1
ErrorSource :
ErrorType : 0
StatusCode : 1
Message : A general error occurred that is not covered by a more specific error code.
Data : {}
InnerException :
TargetSite : Void ProcessNativeCallback(Microsoft.Management.Infrastructure.Native.OperationCallbackProcessingContext, T, Boolean, Microsoft.Management.Infrastructure.Native.MiResult,
System.String, Microsoft.Management.Infrastructure.Native.InstanceHandle)
StackTrace : at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext,
T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)
HelpLink :
Source : Microsoft.Management.Infrastructure
HResult : -2146233088
Environment data
PSVersion 5.1.26100.7019
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.7019
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1,
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
dsc 3.1.1
Visuals
No response
- Lingua principale
- Rust
- Stelle
- 526
- Fork
- 76
- Merge medio
- 4g 20h
- PR unite (30g)
- 24
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PowerShell/DSC
-
Issue-Enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
PowerShell/DSC#1729 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Feature Request: Support dsc functions in executable argsForse già presa @SteveL-MSFT l’ha presa 1 giorno fa. ApertaIssue-Enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
PowerShell/DSC#1722 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Dev-UX Needs Triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PowerShell/DSC#1694 ·
I maintainer di solito rispondono entro 1 giorno
-
Issue-Enhancement Needs Triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
PowerShell/DSC#1683 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Issue-Enhancement Needs Triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PowerShell/DSC#1673 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PowerShell/DSC
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Docs: "Work with Codex from anywhere" page still claims Windows mobile support is "coming soon"Apertaapp documentation remote windows-os
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oxidecomputer/dendrite#380 ·
I maintainer di solito rispondono entro 5 giorni
-
area:cli bug good first issue priority:high
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
rtk-ai/rtk#4249 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno