Override properties block when including a psake script in an other psake script

Posted by DanceAlot on Stack Overflow See other posts from Stack Overflow or by DanceAlot
Published on 2012-10-14T15:23:34Z Indexed on 2012/10/14 15:37 UTC
Read the original article Hit count: 141

Filed under:
|
|
|

I am new to psake and I have this issue: I have 2 psake scripts:

(1): base_tasks.ps1:

properties{

$a = "hello"

$b = "hi"

}

task One{ Write-Host $a }

(2): install.ps1

Include .\base_tasks.ps1

properties{

$a = "Goodbye"

$b = "Adjeu"

}

task default -depends One

Now, is it possible to override the properties and variables from file 1? I want to use file 1 as "base tasks" and use the tasks in the install.ps1 and override the properties. Or do I have to do that an other way? I will invoke install.ps1 and use my $a and $b from install.ps1.

  • DanceAlot

© Stack Overflow or respective owner

Related posts about powershell

Related posts about properties