cancel
Showing results for 
Search instead for 
Did you mean: 

Passing variables from a recipe into PowerShell

joshdehnke
Deputy Chef I
Deputy Chef I

Hello Everyone,

I was wondering if anyone has ever attempted to pass variables from a recipe into a PowerShell script. What I'm trying to accomplish is sending an email address that is gathered as the variable in the recipe to a specific PowerShell script running on a local server. I currently have the local AD connection up and running as well.

1 ACCEPTED SOLUTION

panku
Deputy Chef II
Deputy Chef II

Hi @joshdehnke 

Yes, I worked on a similar requirement where I needed to pass dynamic variable values to a powershell script. Please refer the below command.

powershell.exe script-path -email {{emailvalue}}

emailvalue will be available as a datapill and you can pass the value from your recipe.

Thanks

Pankaj

View solution in original post

1 REPLY 1

panku
Deputy Chef II
Deputy Chef II

Hi @joshdehnke 

Yes, I worked on a similar requirement where I needed to pass dynamic variable values to a powershell script. Please refer the below command.

powershell.exe script-path -email {{emailvalue}}

emailvalue will be available as a datapill and you can pass the value from your recipe.

Thanks

Pankaj