Skip to main content

Include

This page was generated

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

Included scripts are dot-sourced into the build script's scope after the build file finishes loading. You can call Include more than once.

EXAMPLES

EXAMPLE 1

Include ".\build_utils.ps1"
Task default -depends Test
Task Test -depends Compile, Clean {
}
Task Compile -depends Clean {
}
Task Clean {
}

Includes all functions and variables from build_utils.ps1 in the build script's scope.

EXAMPLE 2

@("File1.ps1","File2.ps1") | Include
Get-ChildItem | Include

Strings or FileInfo objects can be piped to the Include function

PARAMETERS

-LiteralPath

Path to the script file to include. No wildcard expansion.

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

Path to the script file(s) to include. Supports wildcards.

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

The path(s) to the script file(s) to include in the build.

System.String

OUTPUTS

NOTES

VERSION

This page was generated using comment-based help in Psake 5.0.4.