Calling "PSDesiredStateConfiguration/WindowsOptionalFeature" Fails with Error
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- powershell, yaml
- Bereich
- devops
Rechercherichtung
Beginne damit, das Problem mit test.config.dsc.yaml und dem bereitgestellten dsc.exe config get-Befehl zu reproduzieren. Verfolge den Fehler ab ResourceProviderAdapter.GetPSObjectArrayValue im gemeldeten Stacktrace und vergleiche die Eingabe der WindowsOptionalFeature-Ressource mit dem protokollierten Cast-Fehler. Als erledigt gilt die Aufgabe, wenn die Konfiguration ein Ergebnis statt des gemeldeten Fehlers zurückgibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Rust
- Sterne
- 541
- Forks
- 78
- Ø Merge
- 2 T. 22 Std.
- Gemergte PRs (30 T.)
- 17
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/DSC
-
Failure to parse a resource manifest is logged as INFO instead of WARNEvtl. vergeben @SteveL-MSFT hat das vor 3 Tagen übernommen. OffenIssue-Bug Need-Review
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
PowerShell/DSC#1765 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Tracing categoriesEvtl. vergeben @michaeltlombardi hat das vor 5 Tagen übernommen. OffenArea-OpenTelemetry Issue-Enhancement Needs Triage
PowerShell/DSC#1767 · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Issue-Enhancement Needs Triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
PowerShell/DSC#1763 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Issue-Enhancement Needs Triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
PowerShell/DSC#1760 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Hardening with dsc 3 ?Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. OffenIssue-Enhancement Needs Triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 12/100
PowerShell/DSC#1755 · 7 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
manuscript-lang/manuscript#1364 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
fable-compiler/Fable#5157 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
Maintainer antworten meist innerhalb von 1 Tag
-
C-bug needs-triage O-UEFI T-libs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
移动端宽屏适配Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
Maintainer antworten meist innerhalb von 1 Tag