Skip to content

Instantly share code, notes, and snippets.

@duffney
Created February 12, 2016 19:30
Show Gist options
  • Save duffney/05091dfe1a91699e69a3 to your computer and use it in GitHub Desktop.
Save duffney/05091dfe1a91699e69a3 to your computer and use it in GitHub Desktop.
function Publish-DSCResourcePull {
Param(
[string[]]
$Module
)
foreach ($ModuleName in $Module){
$ModuleVersion = (Get-Module $ModuleName -ListAvailable).Version
Compress-Archive -Update `
-Path "$Env:PROGRAMFILES\WindowsPowerShell\Modules\$ModuleName\$ModuleVersion\*" `
-DestinationPath "$Env:PROGRAMFILES\WindowsPowerShell\DscService\Modules\$($ModuleName)_$($ModuleVersion).zip"
New-DscChecksum "$Env:PROGRAMFILES\WindowsPowerShell\DscService\Modules\$($ModuleName)_$($ModuleVersion).zip"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment