< Back

Clear-CMofAuthoringMetadata

Sun Jan 12, 2020 8:59 pm

NAME Clear-CMofAuthoringMetadata



SYNOPSIS

Removes authoring metadata from .mof files.





SYNTAX

Clear-CMofAuthoringMetadata [-Path] <String> [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Everytime PowerShell generates a .mof file, it includes authoring metadata: who created the file, on what

computer, and at what date/time. This means a .mof file's checksum will change everytime a new one is generated,

even if the configuration in that file didn't change. This makes it hard to know when a configuration in a .mof

file has truly changed, and makes its change history noisy. This function strips/removes all authoring metadata

from a .mof file.



When given a path to a file, all authoring metadata is removed from that file. When given the path to a directory,

removes authoring metadata from all `*.mof` files in that directory.



Essentially, these blocks from each .mof file:



/*

@TargetNode='********'

@GeneratedBy=********

@GenerationDate=08/19/2014 13:29:15

@GenerationHost=********

*/



/* ...snip... */





instance of OMI_ConfigurationDocument

{

Version="1.0.0";

Author="********;

GenerationDate="08/19/2014 13:29:15";

GenerationHost="********";

};



Would be changed to:



/*

@TargetNode='JSWEB01L-WHS-08'

*/



/* ...snip... */



instance of OMI_ConfigurationDocument

{

Version="1.0.0";

};





`Clear-CMofAuthoringMetadata` is new in Carbon 2.0.





PARAMETERS

-Path <String>

The path to the file/directory whose .mof files should be operated on.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Clear-CMofAuthoringMetadata -Path 'C:\\Projects\\DSC\\localhost.mof'



Demonstrates how to clear the authoring data from a specific file.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Clear-CMofAuthoringMetadata -Path 'C:\\Projects\\DSC'



Demonstrates how to clear the authoring data from all .mof files in a specific directory.











RELATED LINKS