microsoftgraph / microsoftgraph/msgraph-sdk-powershell

New-MgDeviceManagementDeviceConfiguration always throws Cannot create an abstract class.

Open
#2,742 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

I am trying to create a Windows10 Custom Configuration but It keeps returning "Cannot create an abstract class"

Expected behavior

Create and return the Device Configuration

How to reproduce
  1. Execute Connect-MgGraph -Scopes @("deviceManagement.ReadWrite.All")
  2. Create body hashtable
$body = @{
        "@odata.type" = "#microsoft.graph.windows10CustomConfiguration"
        description   = "Description value"
        displayName   = "Display Name value"
        version       = 7
        omaSettings   = @(
            @{
                "@odata.type" = "microsoft.graph.omaSetting"
                displayName   = "Display Name value"
                description   = "Description value"
                omaUri        = "Oma Uri value"
            }
        )
    }
  1. Execute New-MgDeviceManagementDeviceConfiguration -BodyParameter $body
SDK Version

2.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

- PSVersion: 7.4.1
- PSEdition: Core
- GitCommitId: 7.4.1
- 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

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with New-MgDeviceManagementDeviceConfiguration and the Windows 10 custom configuration body shown in the issue, using SDK version 2.16.0. Trace how the cmdlet handles the @odata.type values for windows10CustomConfiguration and omaSetting. Done means the command creates and returns the device configuration instead of throwing "Cannot create an abstract class," with regression coverage for the reported body.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.