PowerShell C# Module: Show information when module is imported RRS feed

  • Question

  • Hi,

    I have written a PowerShell Module in C#. All tested and working, now just adding in the finer details such as help. I want to be able to show a message when the module is loaded though - sort of an introduction text. Only a couple of lines, so that it looks like this (obviously with useful relevant information though):

    PS C:\> Import-Module ThisModuleName
    Hi, you have loaded the module!!
    PS C:\>

    I can't seem to work out how to output text though after the module load event.

    As a side, but related, I would like to implement a module level help page, so that when a user entered something like Get-Help About_ModuleName some further information was shown. Is this possible?



    • Edited by Craig Tolley Wednesday, September 30, 2015 1:53 PM
    Wednesday, September 30, 2015 1:52 PM


All replies