For the last 3-4 days octopus seems to have stopped loading Script Modules. I’ve created a module called “Test” that contains the default “Say-Hello” function and i get this error:
say-hello : The term 'say-hello' is not recognized as the name of a cmdlet,
Error 02:23:22
function, script file, or operable program. Check the spelling of the name, or
Error 02:23:23
if a path was included, verify that the path is correct and try again.
Error 02:23:23
At C:\Windows\system32\config\systemprofile\AppData\Local\Tentacle\Temp\3bc4b8a
Error 02:23:23
8-1e64-4463-ae50-fd89eab74ea4.ps1:1 char:1
I can see the module supposedly added on the Process tab
Available script modules: test, configure…
This is happening with old and new script modules.
We have another environment with 2.5+ which is not experiencing this issue. 2.4.7.85 was working fine last week though.
No strange logs on the viewer have been found.
If you guys need data from RavenDB for troubleshooting please let me know.
Thanks for getting in touch! Is it possible at all your 2.4.7 tentacles have been upgraded or had changes made (inside windows).
If you haven’t upgraded Octopus in this time, it makes no sense they are just failing. We did have one user on their environment have this ‘say-hello’ issue, and when calling the script adding a line break at the end was all that was needed to correctly call the function. We determined it to be an issue with PowerShell behaving badly. (It would also cache when it detected no changes).
Are all of your script function calls a single line PowerShell?
Are also all of your errors exactly the same as the one below?
Thanks for getting in touch! Our documentation is clearly lacking in this area. I have put a task in to make sure we add some.
But let’s see if I can explain this well enough.
If you go to the following post http://octopusdeploy.com/blog/2.4 There is a section about Script Modules.
It is designed for times when you have a PowerShell function that you want to reuse in either multiple steps in a project, or multiple projects with one base place to manage the code.
However what is not explicitly mentioned in the blog post, is it is included as part of each step when it is included as part of a project, so it should really only contain functions and not code that would run on each step.
Let me know if you need any further clarification or have any questions.
Vanessa