Include
Contributions are welcome in Psake-repo.
SYNOPSIS
Include the functions or code of another powershell script file into the current build script's scope
SYNTAX
Path (Default)
Include [-Path] <string> [<CommonParameters>]
LiteralPath
Include [-LiteralPath] <string> [<CommonParameters>]
DESCRIPTION
A build script may declare an "includes" function which allows you to define a file containing powershell code to be included and added to the scope of the currently running build script. Code from such file will be executed after code from build script.
EXAMPLES
EXAMPLE 1
Include ".\build_utils.ps1"
Task default -depends Test
Task Test -depends Compile, Clean {
}
Task Compile -depends Clean {
}
Task Clean {
}
The script above includes all the functions and variables defined in the ".\build_utils.ps1" script into the current build script's scope
Note: You can have more than 1 "Include" function defined in the build script.
EXAMPLE 2
@("File1.ps1","File2.ps1") | Include
Get-ChildItem | Include
Strings or FileInfo objects can be piped to the Include function
PARAMETERS
-LiteralPath
A string containing the path and name of the powershell file to include (no wildcards)
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: LiteralPath
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Path
A string containing the path and name of the powershell file to include (wildcards can be used)
Type: System.String
DefaultValue: ''
SupportsWildcards: true
Aliases:
- fileNamePathToInclude
ParameterSets:
- Name: Path
Position: 0
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.String
{{ Fill in the Description }}
OUTPUTS
NOTES
RELATED LINKS
VERSION
This page was generated using comment-based help in Psake 5.0.3.