# Tryng to use Powershell to get Compiler Action info

**URL:** https://www.finalbuilder.com/forums/t/tryng-to-use-powershell-to-get-compiler-action-info/1093
**Category:** Discussion
**Created:** [January 31, 2009, 12:20pm UTC](https://www.finalbuilder.com/forums/t/tryng-to-use-powershell-to-get-compiler-action-info/1093 "2009-01-31T12:20:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![boylank](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@boylank](https://www.finalbuilder.com/forums/u/boylank)
#### Post date: [January 31, 2009, 12:20pm UTC](https://www.finalbuilder.com/forums/t/tryng-to-use-powershell-to-get-compiler-action-info/1093/1 "2009-01-31T12:20:34Z")

</div>

Hi,

Using FB 6.2, I am trying to use Powershell in a BeforeAction event for a Delphi Compiler Action and I want to retrieve the OutputDir option from the Action.&nbsp; I am able to get the value ok by doing this:

$theDir = $Action.OutputDir

echo $theDir

The result is %BUILD\_TYPE% which is what I had entered into that option.&nbsp; However, I want this to be expanded.&nbsp; I do have IsMacro checked for that variable so I thought I would get the actual value for that variable but apparently not.

So I thought maybe this would do it:

$theDir = $FBVariables.GetVariable($Action.BPLOutputDir)

but this returns nothing.

Can someone tell me how to get what I have in the OutputDir option for the Delphi Compiler Action into a PowerShell variable?

Thanks!

Kevin

&nbsp;

---

<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 31, 2009, 1:08am UTC](https://www.finalbuilder.com/forums/t/tryng-to-use-powershell-to-get-compiler-action-info/1093/2 "2009-01-31T01:08:05Z")

</div>

Hi Kevin   
  
 You should be able to do this :   
  
 $theDir = $Action.ExpandExpression($Action.OutputDir)   
  
 however when I just tested this I got an error. I’ll look into this first thing monday morning.

---

<div class="post-metadata">

### Author: ![boylank](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@boylank](https://www.finalbuilder.com/forums/u/boylank)
#### Post date: [January 31, 2009, 1:57am UTC](https://www.finalbuilder.com/forums/t/tryng-to-use-powershell-to-get-compiler-action-info/1093/3 "2009-01-31T01:57:21Z")

</div>

Thanks Vincent.&nbsp;
