Skip to content

Get SamplerProjectBuildInfo

gaelcolas edited this page May 15, 2026 · 1 revision

Get-SamplerProjectBuildInfo

SYNOPSIS

Resolves common project build inputs and identifies the project build type.

SYNTAX

Get-SamplerProjectBuildInfo [-ProjectPath] <String> [-OutputDirectory] <String>
 [[-BuiltModuleSubdirectory] <String>] [-VersionedOutputDirectory] [[-ProjectName] <String>]
 [[-SourcePath] <String>] [[-ModuleVersion] <String>] [-BuildInfo] <Hashtable>
 [<CommonParameters>]

DESCRIPTION

This function normalizes values used by build tasks and identifies what kind of project is being built.

A project is treated as a PowerShell module when the source root contains exactly one valid module manifest (*.psd1, excluding build/analyzer settings manifests) and that manifest has the publishing metadata needed for a build.

If the project is a PowerShell module and a built manifest can be resolved in output, HasBuiltOutput is $true; otherwise $false.

EXAMPLES

EXAMPLE 1

Get-SamplerProjectBuildInfo -ProjectPath $BuildRoot -OutputDirectory $OutputDirectory -BuildInfo $BuildInfo

PARAMETERS

-BuildInfo

Build configuration hashtable from build.yaml.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: True
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-BuiltModuleSubdirectory

Optional built module subdirectory under the output directory.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModuleVersion

Optional module version. If omitted, this function does not synthesize a fallback value and leaves version resolution to downstream build logic such as Set-SamplerTaskVariable -AsNewBuild.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OutputDirectory

Root output directory that contains the built module and related build artifacts for the project.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProjectName

Optional project or module name. If omitted, this function tries to infer it from build metadata or the source manifest.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProjectPath

Root path of the project or repository.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SourcePath

Optional source path. If omitted, this function tries to resolve it.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-VersionedOutputDirectory

Specifies whether the built module output is versioned.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

System.Collections.Hashtable

NOTES

RELATED LINKS

Clone this wiki locally