Using my own Powershell script module in Octopus, Octopus is warning that
WARNING: Some imported command names contain one or more of the following restricted characters: # , ( ) {{ }} [ ] & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~
The script module looks like this
function complete-iis-config($poolAndSitenameFilter)
{
# do stuff
}
export-modulemember -function complete-iis-config
In PowerShell 2.0, you can import a newly-installed PowerShell module with a call to Import-Module cmdlet. In PowerShell 3.0, PowerShell is able to implicitly import a module when one of the functions or cmdlets in the module is called by a user.
Module Auto-Loading Beginning in PowerShell 3.0, PowerShell imports modules automatically the first time that you run any command in an installed module. You can now use the commands in a module without any set-up or profile configuration, so there's no need to manage modules after you install them on your computer.
Install-Module installs the necessary files to your computer to run/load the module. Either to your profile path or to the program files folder. Import-Module loads an available module to the currently running instance of Powershell.
This is because I used a hyphen twice. The Verb-Noun
PowerShell guideline means there should only be one hyphen.
Renaming my function to Complete-IisConfig
cleared the warning
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With