dsccommunity / DscResource.Common

This module contains common functions that are used in DSC resources.
https://dsccommunity.org
MIT License
9 stars 9 forks source link

`Set-PSModulePath`: Support adding Machine and User environment variables to session #102

Closed johlju closed 8 months ago

johlju commented 1 year ago

Suggest adding logic to the command Set-PSModulePath so that it is easy to set the session PSModulePath to the same paths as Machine and User target has.

Suggest adding a new parameter set parameter FromTarget (mutually exclusive to parameter Machine) with the type String[] that has a validate set of Session, User, Machine. It passes that parameter to a command Get-PSModulePath that returns the concatenated paths (separated with semi-colon) depending on what targets was passed to the parameter. Multiple targets should be able to be passed.

johlju commented 1 year ago

This will help reduce code in the module SqlServerDsc's command Import-SqlDscPreferredModule.

johlju commented 1 year ago

Dependent on issue #103 .

johlju commented 8 months ago

This can work if we add a new parameter set with the only parameters FromTarget and ToTarget, and keep the existing parameters as the default parameters set. Need to avoid a breaking change.