This post was created and closed http://help.octopusdeploy.com/discussions/problems/24598-script-libraries-running-everytime, I ran into the same issue and found the solution, if the script in the library doesn’t have a declaration “like function greetings { Write-Host “Hi”}” and just has a body " Write-Host “Hi”", the script will be executed automatically without been invoked which in my case the script execution was failing as it required parameters and they were not been passed. Also I was having a hard time finding documentation on how to use the Script Libraries, some documentation on that would be really nice.
Hope this helps to other people, this took me a bit to figure out.
Thanks
Fabian