I'm trying to populate the results from a powershell snippet into an Automise variable using a Run Script action specifying Powershell as the scripting language.
I assume this is possible and I'm not running it correctly. Anyone care to set me straight? BTW Powershell 3 & Automise 4.0.0.358 is what I have on my Win 7 box.
I suspect the help is wrong, I will check tomorrow when I get to the office. It may also have worked that way before and is broken. This works for me :
The help is partially correct. The same help file is shared between FinalBuilder and Automise, but the variable collection name is different between the two products. So this works :
$ATVariables.SetVariable(“AA”,“hello world”)
The reason for needing to cast is because powershell cmdlets usually return objects, which can’t be stored in automise variables (which is done via com interop, which doesn’t know how to work with powershell/.net objects).
So I assume you are going to have the help file updated to reflect this? It might also be a good idea to include a couple of examples ... and also include the casting stuff.
Hello. I just searched the most recent automise help file and I see that the help file has not been updated. It still refers to $FBVariables.SetVariable() on page 59.
Also, I see there is also an Execute Powershell Script Action (pp 726). Can this action also pass variables back via the $ATVariables.SetVariable commands, or just the scripting tool?
The Execute Powershell script action executes an external instance of powershell, so it can’t set Automise varibales. Use the Run Script action, in the script editor set the language to Powershell. This executes the script in process and can interact with Automise. using