Parameters don't seem to work for me

Nov 6, 2009 at 2:48 AM
Edited Nov 6, 2009 at 2:50 AM

I am sure I am doing something wrong but not sure what.  I have tried to use your PowerShell task but it keeps telling me I am not passing in the parameters.

Here is the script I am trying to execute ...

F:\Builds\SSISDeployment\ssis-generate.ps1 -oldVersion 1.0.0.0 -src F:\Build\TestTask\Drop\SSIS\

The first line of the script looks like this...

Param([string]$oldVersion, [string]$src)

I have tried...

<Powershell Script="f:\Builds\SSISDeployment\ssis-generate.ps1" Arguments="oldVersion=1.0.0.0;src=$(SSISDropLocation)" />

<Powershell Script="f:\Builds\SSISDeployment\ssis-generate.ps1" Arguments="value1=1.0.0.0;value2=$(SSISDropLocation)" />

<PropertyGroup>
   <oldVersion>1.0.0.0</oldVersion>
   <src>$(SSISDropLocation)</src>
</PropertyGroup>
<Powershell Script="f:\Builds\SSISDeployment\ssis-generate.ps1" TaskItems="$(oldVersion);$(src)" />

...AND...

<PropertyGroup>
 <Argument1>1.0.0.0</Argument1>
 <Argument2>$(SSISDropLocation)</Argument2>
</PropertyGroup>
<Powershell Script="f:\Builds\SSISDeployment\ssis-generate.ps1" TaskItems="$(Argument1);$(Argument2)" />

All of these give the same result.  The script returns telling me I need to pass in the parameters.  What am I doing wrong?

Nov 6, 2009 at 4:12 PM

I figured out the problem.  When running an external script you need to use the "ScriptFile" attribute.  Although it briefly mentions this in the Usage link the schema that creates the intellisense is out-of-date so it does not show the ScriptFile attribute.

The correct form in my case is ...

<Powershell ScriptFile="f:\Builds\SSISDeployment\ssis-generate.ps1" Arguments="oldVersion=1.0.0.0;src=$(SSISDropLocation)" />

Coordinator
Nov 6, 2009 at 4:20 PM

Oops. I'll update the schema.

Coordinator
Nov 6, 2009 at 4:40 PM

I've uploaded a new release that only contains the schema fix.