# Am I missing something? (execute powershell script)

**URL:** <https://www.finalbuilder.com/forums/t/am-i-missing-something-execute-powershell-script/1425>\
**Category:** Discussion\
**Created:** [January 15, 2010, 4:19am UTC](https://www.finalbuilder.com/forums/t/am-i-missing-something-execute-powershell-script/1425 "2010-01-15T04:19:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [January 15, 2010, 4:19am UTC](https://www.finalbuilder.com/forums/t/am-i-missing-something-execute-powershell-script/1425/1 "2010-01-15T04:19:04Z")

</div>

Whenever I&nbsp;use the script editor for any action (BeforeAction,AfterAction), I&nbsp;can easily get/set variables by using for example $FBVariables.GetVariable("somevariable")

If I&nbsp;use the execute powershell script action and specify the script text, I am unable to access variables using the same method as above.&nbsp; I realize I can partially&nbsp;get around this by passing variable parameters in the options tab of the action setup, but how would I set variables?

Is there a reason I&nbsp;can't access get/set variable the regular way?&nbsp;&nbsp;I&nbsp;am hoping its possible I am just doing something wrong.&nbsp; I&nbsp;don't know a great deal about powershell

Thanks

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [January 15, 2010, 9:36am UTC](https://www.finalbuilder.com/forums/t/am-i-missing-something-execute-powershell-script/1425/2 "2010-01-15T09:36:37Z")

</div>

The Powershell Action actually runs powershell.exe, so it doesn’t have access to $FBVariables. Use the Execute Script Action, and set the script language to Powershell. Then you will have access to $FBVariables (which btw is a collection, so you can do stuff like $blah = $FBVariables[“blah”] ).

---

<div class="post-metadata">

**Author:** ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)\
**Post date:** [January 19, 2010, 1:20am UTC](https://www.finalbuilder.com/forums/t/am-i-missing-something-execute-powershell-script/1425/3 "2010-01-19T01:20:14Z")

</div>

thanks. I was not aware of that.
