Skip to content

Instantly share code, notes, and snippets.

@techthoughts2
Created June 11, 2018 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techthoughts2/f628ccaf06540e3a7199328c6d397001 to your computer and use it in GitHub Desktop.
Save techthoughts2/f628ccaf06540e3a7199328c6d397001 to your computer and use it in GitHub Desktop.
Azure Automation DSC is sensitive to how you zip up modules for upload. As shown below, to ensure your custom DSC module is properly uploaded zip it with the Publish-ModuleToPullServer cmdlet.
#used for zipping up custom dsc resources prior to upload to Azure automation
#--------------------------------------------------------------------------------
#install the required xPSDesiredStateConfiguration module if you haven't already:
#Install-Module xPSDesiredStateConfiguration
#--------------------------------------------------------------------------------
#import the module
Import-Module xPSDesiredStateConfiguration
#--------------------------------------------------------------------------------
#create the module .zip for Azure uploading
Publish-ModuleToPullServer -Name xNetworking -OutputFolderPath C:\DSC\Uploads `
-ModuleBase 'c:\Program Files\WindowsPowerShell\Modules\xNetworking' -Version 5.6.0.0
#--------------------------------------------------------------------------------
#rename the zip file to not include the version number
#Rename-Item .\xNetworking_5.6.0.0.zip -NewName xNetworking.zip
#--------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment