Skip to content

Get SamplerModuleRootPath

gaelcolas edited this page Jul 18, 2024 · 1 revision

Get-SamplerModuleRootPath

SYNOPSIS

Gets the absolute ModuleRoot path (the psm1) of a module.

SYNTAX

Get-SamplerModuleRootPath [-ModuleManifestPath] <String> 
 [<CommonParameters>]

DESCRIPTION

This function reads the module manifest (.psd1) and if the ModuleRoot property is defined, it will resolve its absolute path based on the ModuleManifest's Path.

If no ModuleRoot is defined, then this function will return $null.

EXAMPLES

EXAMPLE 1

Get-SamplerModuleRootPath -ModuleManifestPath C:\src\MyModule\output\MyModule\2.3.4\MyModule.psd1
# C:\src\MyModule\output\MyModule\2.3.4\MyModule.psm1

PARAMETERS

-ModuleManifestPath

The path (relative to the current working directory or absolute) to the ModuleManifest to read to find the ModuleRoot.

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

Required: True
Position: 1
Default value: None
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