How to run a PowerShell module using EasyKiwi

219 views Asked by At

I have a PowerShell script.

It contains one main functions and two auxiliary functions. I need this script to pass the EasyKiwi test (the module needs to be imported successfully). Does anyone know what are the conventions and what should I do in order to make my script pass the EasyKiwi test? There's no much information on the internet about it. As I understood I need to run some commandlets in order to install EasyKiwi on Windows PowerShell. Then I need to create there a module. This operation will create the module folder. In this folder I will have a private folder (there I will put my auxiliary functions) and a public folder (there I will put my main function).

Is it correct?

If so, what should I do next?

1

There are 1 answers

0
postanote On

I have no idea what EasyKiwi is, never heard of it, but if they do not provide docs on PowerShell, then we are all left to guess.

Lastly, importing modules, is just a matter of using Import-Module or Add-Type if it is a .dll file. You can Import-Module from anywhere, but if you want autoload of said module the you have to plan for that. She the PowerShell guidance TechNet docs for that.

Import-Module

Add-Type

All of which, use the help files and examples therein.

# get function / cmdlet details
(Get-Command -Name Import-Module).Parameters
Get-help -Name Import-Module -Full
Get-help -Name Import-Module -Online
Get-help -Name Import-Module -Examples


(Get-Command -Name Add-Type).Parameters
Get-help -Name Add-Type -Full
Get-help -Name Add-Type -Online
Get-help -Name Add-Type -Examples

PowerShell Troubleshooting: Module does not autoload

Symptoms Powershell v 3.0 or later does not autoload modules $PSModuleAutoLoadingPreference has not been tampered with manual import of module works Get-Module -ListAvailable | Import-module works Possible Cause:custom module has been imported (ex: in C:\Windows\System32\W