Answered by:
PowerShell C# Module: Show information when module is imported

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?
Thanks,
Craig.
- Edited by Craig Tolley Wednesday, September 30, 2015 1:53 PM
Wednesday, September 30, 2015 1:52 PM
Answers
-
You can get help with powershell here.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
and C# over here.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Marked as answer by Craig Tolley Wednesday, September 30, 2015 1:58 PM
Wednesday, September 30, 2015 1:56 PM
All replies
-
You can get help with powershell here.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
and C# over here.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Marked as answer by Craig Tolley Wednesday, September 30, 2015 1:58 PM
Wednesday, September 30, 2015 1:56 PM -
Hi Craig,
There's a general PowerShell forum here:
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=winserverpowershell
Wednesday, September 30, 2015 1:56 PM -
Thanks, thought I had selected that but obviously not!
Craig.
Wednesday, September 30, 2015 1:58 PM