< Back

Publish-DSCModuleAndMof

Sun Jan 19, 2020 7:25 pm

NAME Publish-DSCModuleAndMof



SYNOPSIS

Package DSC modules and mof configuration document and publish them on an enterprise DSC pull server in the

required format.





SYNTAX

Publish-DSCModuleAndMof [-Source] <String> [-Force] [[-ModuleNameList] <String[]>] [<CommonParameters>]





DESCRIPTION

Uses Publish-DSCModulesAndMof function to package DSC modules into zip files with the version info.

Publishes the zip modules on "$env:ProgramFiles\\WindowsPowerShell\\DscService\\Modules".

Publishes all mof configuration documents that are present in the $Source folder on

"$env:ProgramFiles\\WindowsPowerShell\\DscService\\Configuration"-

Use $Force to overwrite the version of the module that exists in the PowerShell module path with the version from

the $source folder.

Use $ModuleNameList to specify the names of the modules to be published if the modules do not exist in $Source

folder.





PARAMETERS

-Source <String>

The folder that contains the configuration mof documents and modules to be published on Pull server.

Everything in this folder will be packaged and published.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Switch to overwrite the module in PSModulePath with the version provided in $Sources.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ModuleNameList <String[]>

Package and publish the modules listed in $ModuleNameList based on PowerShell module path content.



Required? false

Position? 2

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:\\>$ModuleList = @("xWebAdministration", "xPhp")



Publish-DSCModuleAndMof -Source C:\\LocalDepot -ModuleNameList $ModuleList









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



PS C:\\>Publish-DSCModuleAndMof -Source C:\\LocalDepot -Force















RELATED LINKS