# Execute Program does not expand '$Agent.PowerShell.Default$' in expected way

**URL:** https://www.finalbuilder.com/forums/t/execute-program-does-not-expand-agent-powershell-default-in-expected-way/5269
**Category:** Discussion
**Created:** [November 11, 2014, 1:02am UTC](https://www.finalbuilder.com/forums/t/execute-program-does-not-expand-agent-powershell-default-in-expected-way/5269 "2014-11-11T01:02:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![karmasponge](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/k/4491bb/32.png) [@karmasponge](https://www.finalbuilder.com/forums/u/karmasponge)
#### Post date: [November 11, 2014, 1:02am UTC](https://www.finalbuilder.com/forums/t/execute-program-does-not-expand-agent-powershell-default-in-expected-way/5269/1 "2014-11-11T01:02:53Z")

</div>

I switched from using the ‘Powershell’ action to using the generic ‘Execute Program’ action and was attempting to use the '$Agent.Powershell.Default$ expression  
so that I don’t have to assume the path on the agent machine (that’s what its for right?).  
  
However I discovered when running that action that the path does not expand as expected, instead I would get the following error:  
  
The executable was not found at path C:\Users\Public\ContinuaAgentWorkspace\Ws\80$Agent.PowerShell.Default$.  
  
It appears that its not expanding the expression at all and incorrectly inserting the agent workspace directory into the path  
which is also not desirable.  
  
What am I doing wrong?

---

<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: [November 11, 2014, 1:09am UTC](https://www.finalbuilder.com/forums/t/execute-program-does-not-expand-agent-powershell-default-in-expected-way/5269/2 "2014-11-11T01:09:45Z")

</div>

The expression is wrong, the agent property would be $Agent.PowerShell.Default.Path$

---

<div class="post-metadata">

### Author: ![karmasponge](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/k/4491bb/32.png) [@karmasponge](https://www.finalbuilder.com/forums/u/karmasponge)
#### Post date: [November 11, 2014, 1:13am UTC](https://www.finalbuilder.com/forums/t/execute-program-does-not-expand-agent-powershell-default-in-expected-way/5269/3 "2014-11-11T01:13:53Z")

</div>

Ooops!   
  
 Thanks Vincent!
