< Back

Properties

Sun Jan 19, 2020 5:58 pm

NAME Properties



SYNOPSIS

Define a scriptblock that contains assignments to variables that will be available to all tasks in the build script





SYNTAX

Properties [-properties] <ScriptBlock> [<CommonParameters>]





DESCRIPTION

A build script may declare a "Properies" function which allows you to define variables that will be available to

all the "Task" functions in the build script.





PARAMETERS

-properties <ScriptBlock>

The script block containing all the variable assignment statements



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>A sample build script is shown below:



Properties {

$build_dir = "c:\\build"

$connection_string = "datasource=localhost;initial catalog=northwind;integrated security=sspi"

}



Task default -depends Test



Task Test -depends Compile, Clean {

}



Task Compile -depends Clean {

}



Task Clean {

}



Note: You can have more than one "Properties" function defined in the build script.











RELATED LINKS

Assert

Exec

FormatTaskName

Framework

Get-PSakeScriptTasks

Include

Invoke-psake

Task

TaskSetup

TaskTearDown