Skip to content

Get BuiltModuleVersion

gaelcolas edited this page Jul 18, 2024 · 1 revision

Get-BuiltModuleVersion

SYNOPSIS

Get the module version from the module built by Sampler.

SYNTAX

Get-BuiltModuleVersion [-OutputDirectory] <String> [[-BuiltModuleSubdirectory] <String>] [-ModuleName] <String>
 [-VersionedOutputDirectory] [<CommonParameters>]

DESCRIPTION

Will read the ModuleVersion and PrivateData.PSData.Prerelease tag of the Module Manifest that has been built by Sampler, by looking into the OutputDirectory where the Project's Module should have been built.

EXAMPLES

EXAMPLE 1

Get-BuiltModuleVersion -OutputDirectory 'output' -ProjectName Sampler

PARAMETERS

-BuiltModuleSubdirectory

Sub folder where you want to build the Module to (instead of $OutputDirectory/$ModuleName). This is especially useful when you want to build DSC Resources, but you don't want the Get-DscResource command to find several instances of the same DSC Resources because of the overlapping $Env:PSmodulePath ($buildRoot/output for the built module and $buildRoot/output/RequiredModules).

In most cases I would recommend against setting $BuiltModuleSubdirectory.

Type: String
Parameter Sets: (All)
Aliases:

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

-ModuleName

Name of the Module to retrieve the version from its manifest (See Get-SamplerProjectName).

Type: String
Parameter Sets: (All)
Aliases: ProjectName

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

-OutputDirectory

Output directory (usually as defined by the Project). By default it is set to 'output' in a Sampler project.

Type: String
Parameter Sets: (All)
Aliases:

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

-VersionedOutputDirectory

Whether the Module is built with its versioned Subdirectory, as you would see it on a System. For instance, if VersionedOutputDirectory is $true, the built module's ModuleBase would be: output/MyModuleName/2.0.1/

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.String

NOTES

RELATED LINKS

Clone this wiki locally