Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Variable scopes
-
I am currently trying to create a "Web Server" role for Otter.
My first step was to create a Sequence variable, @WebServerFeatures and then try to loop that collection and use PSEnsure to install the missing windows features.
However, I am having some issues with this.
Otter keeps telling me that @WebServerFeatures are not installed, however if I try and move the variable to the server it self, it works just fine.
TL;DR; I am unable to use a variable on the Role, but it works just fine if its declared on the Server.
Couple of screenshots.
-
You're definitely on the right track... but unfortunately this is a bug :(
It will be fixed in Otter 1.1.2, which will ship pretty soon (along with Linux, Git, etc) support :)
-
Is there a workaround? Its making Otter pretty useless....
-
The easiest workaround is to declare the variable at the top of your plan.
set @WebServerFeatures = @(...)
Otherwise we will get this shipped by end of day!