Skip to content

Disk Resource defines CIM class MSFT_Disk which is a Windows built-in CIM class #167

Closed
@PlagueHO

Description

@PlagueHO

While adding PartitionStyle parameter to Disk (see #137), I realized that the name of the CIM class implemented in the Disk resource (MSFT_Disk) is the same name as the built-in CIM Class (https://msdn.microsoft.com/en-us/library/windows/desktop/hh830493(v=vs.85).aspx).

image

This causes some odd behavior, such as Get-TargetResource to return an object that contains both the parameters defined in the resource MOF and the built in CIM class definition. This also results in any property that exists in the build in CIM Class definition can not be set when returned by Get-TargetResource. So when I tried to implement the PartitionStyle parameter, it worked correctly in Set-TargetResource and Test-TargetResource, but Get-TargetResource would always return the default value from the built-in CIM class (which was Unknown).

This behavior only resulted when xStorage was renamed StorageDsc.

To work around this issue for now I'm going to use the name PartitionFormat for the resource parameter.

In the longer term I think it might be worth considering renaming the resource as I'm not sure if there are any other nasty side effects with conflicting with one of the built-in CIM classes. This would be a significant BREAKING CHANGE however.

@johlju - any thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions