Skip to content

Set SamplerPSModulePath

gaelcolas edited this page Jul 18, 2024 · 1 revision

Set-SamplerPSModulePath

SYNOPSIS

Sets the PSModulePath for the build environment.

SYNTAX

ByPath

Set-SamplerPSModulePath -PSModulePath <String> [-BuiltModuleSubdirectory <String>]
 [-RequiredModulesDirectory <String>] [-PassThru] [-WhatIf] [-Confirm]
 [<CommonParameters>]

BySwitches

Set-SamplerPSModulePath [-BuiltModuleSubdirectory <String>] [-RequiredModulesDirectory <String>]
 [-RemovePersonal] [-RemoveProgramFiles] [-RemoveWindows] [-SetSystemDefault] [-PassThru]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This command let you define the PSModulePath for the build environment. This could be important for DSC related builds when there are conflicts with modules in the Program Files folder.

EXAMPLES

EXAMPLE 1

Set-SamplerPSModulePath -PSModulePath "C:\Modules" -RemovePersonal -RemoveProgramFiles

PARAMETERS

-BuiltModuleSubdirectory

The BuiltModuleSubdirectory that should be added to the PSModulePath.

Type: String
Parameter Sets: (All)
Aliases:

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

-PassThru

Returns the PSModulePath after the command has been executed.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-PSModulePath

Makes the command to set the PSModulePath to the specified value.

Type: String
Parameter Sets: ByPath
Aliases:

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

-RemovePersonal

Removes the personal module path from the PSModulePath.

Type: SwitchParameter
Parameter Sets: BySwitches
Aliases:

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

-RemoveProgramFiles

Removes the Program Files module path from the PSModulePath.

Type: SwitchParameter
Parameter Sets: BySwitches
Aliases:

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

-RemoveWindows

Removes the Windows module path from the PSModulePath.

Type: SwitchParameter
Parameter Sets: BySwitches
Aliases:

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

-RequiredModulesDirectory

The RequiredModulesDirectory that should be added to the PSModulePath.

Type: String
Parameter Sets: (All)
Aliases:

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

-SetSystemDefault

Sets the PSModulePath to the default value for the system.

Type: SwitchParameter
Parameter Sets: BySwitches
Aliases:

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
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