locked
How to create automation module RRS feed

  • Question

  • Hello,

    I have Utilities.psm1 and a Utilities.psd1 files that are in a folder named Utilities that is zipped and uploaded as an asset to Azure automation. Process succeeds, but within the asset commands are not visible and I cannot search by name. Any ideas what am I doing wrong?

    Is there any guidance or tutorials on this subject?

    Thank you. 


    Sean Feldman

    Monday, April 28, 2014 1:58 AM

Answers

  • Hey Sean, welcome back to the forums ;)

    We do have a blurb on authoring Automation Integration Modules. Its in the Runbook Authoring guide -- scroll down to the "Building an Integration Module" section.

    The most common issue people run in to is that the zipped up module package must contain a single folder within the zip file, which has the same name as the zip file. Within this folder, there needs to be at least one file with the same name as the folder, and either the extension .psd1, .psm1, or .dll.

    From the "Building an Integration Module blub I linked to above:

    "The Integration Module package is a compressed file with the same name as the module and a .zip extension. It contains a single folder also with the name of the module. The Windows PowerShell module and any supporting files, including a manifest file (.psd1) if the module has one, must be contained in this folder."

    Let me know if you need further assistance.

    • Marked as answer by Joe Levy_ Tuesday, April 29, 2014 4:57 AM
    Tuesday, April 29, 2014 4:57 AM

All replies

  • Hey Sean, welcome back to the forums ;)

    We do have a blurb on authoring Automation Integration Modules. Its in the Runbook Authoring guide -- scroll down to the "Building an Integration Module" section.

    The most common issue people run in to is that the zipped up module package must contain a single folder within the zip file, which has the same name as the zip file. Within this folder, there needs to be at least one file with the same name as the folder, and either the extension .psd1, .psm1, or .dll.

    From the "Building an Integration Module blub I linked to above:

    "The Integration Module package is a compressed file with the same name as the module and a .zip extension. It contains a single folder also with the name of the module. The Windows PowerShell module and any supporting files, including a manifest file (.psd1) if the module has one, must be contained in this folder."

    Let me know if you need further assistance.

    • Marked as answer by Joe Levy_ Tuesday, April 29, 2014 4:57 AM
    Tuesday, April 29, 2014 4:57 AM
  • Joe,

    Thank you for your response and link. My mistake was to include both .psm1 and .psd1 Once I have removed .psd1 everything was back to normal. Also, I didn't need to do Export-ModuleMember

    Sean


    Sean Feldman

    Tuesday, April 29, 2014 5:15 AM
  • Can you post the original module that wasn't working? You should be allowed to have both a psd1 and psm1...
    Tuesday, April 29, 2014 6:40 AM
  • Sorry, Joe. After reading your post I got rid of .psd1 file

    Sean Feldman

    Tuesday, April 29, 2014 6:41 PM
  • Are you sure you had the .psd1 file pointing at the .psm1 file via the RootModule attribute in the psd1?

    # Script module or binary module file associated with this manifest.
    RootModule = 'Utilities.psm1'

    If you didn't have this, the module would appear to have no cmdlets because the psd1 does not reference that the psm1 should be loaded.

    Did you try importing the module that wasn't working in a local PowerShell console? Were you able to get this module's cmdlets to show up there?


    Tuesday, April 29, 2014 10:05 PM
  • Looks like the first option is what happened, since I can't recall that statement. 

    Sean Feldman

    Tuesday, April 29, 2014 11:44 PM
  • This is a detail I missed for my own case. By default, this line is commented out with the Visual Studio templates. Leaving it this way will keep the exported functions from showing up as activities.
    Tuesday, March 27, 2018 4:46 PM