Iterator prompt

is it possible to prompt the user for a list of server names that the project will iterate through and run certain actions?  I tried creating "enhanced prompt for variables" and selected a project variable I created and made it a type "memo".  This gave me the prompt I want, which has a multiline text field that I can paste a server list to.  The list is one servername per line.  If I run this, then it saves the entire list into the variable.  But I can't figure out how to iterate through the list that is stored in the variable and apply an action, such as copy a file to all servers in the list at \\%SERVER%\c$\temp

 

Hi David

Use the List Iterator action, in the List of Items field, put a reference to your variable that contains the list, ie %SERVERLIST%. Set the variable field on your action to SERVER (assuming you have declared that variable already), then make your processing actions children of the iterator action.

That worked, thanks! Whats the difference between “Run script” vs “execute powershell script” action? I notice that in “run script” and specifying powershell, it runs but I never see another powershell process spawned in taskmgr. Are you using the powershell SDK automation library here?

I just need to be sure i’m running powershell in 64bit mode, but the “run script” action doesn’t allow me to specify it but it does seem faster than the “execute powershell script”

Run script loads up the powershell assemblies and runs the script inprocess… so that would be 32bit only as Automise is a 32bit process. The advantage this brings (apart from speed) is better interaction with Automise variables.

Execute Powershell script executes powershell.exe, which is slower but does allow running the 64bit version.

Ok I see. So if I want to run in 64bit powershell, then I need to use environment variables instead of project variables?

Modified environment variables in in a spawned process will not be seen the spawing process, that’s just how environment variables work on windows (each process get’s it’s own private environment block).

so whats the best option for passing variables to 64bit powershell from autowise? I think I should be able to pass them as a parameter to a ps1 script right? any suggestions?

On the Options tab of the Powershell actions, you can add parameters. Note you also need to declare the parameters in your script, e.g

[code]param($Param1)write-host $Param1 [/code]