dsccommunity / dsccommunity/CommonTasks
RequiredModulesDirectory Override Parameter in build.ps1 not working
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 45
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Problem description
When trying to use the RequiredModulesDirectory parameter to override the default location of the RequireModules folder (output/RequiredModules) the path passed in never gets populated with the RequiredModule files, they continue to land in output/RequiredModules.
Verbose logs
No logs, just the resultant RequiredModules files are in the wrong place during build.
How to reproduce
Launch the build as follows:
.\build.ps1 -ResolveDependency -RequiredModulesDirectory RequiredModules
Expected behavior
RequiredModules files should end up in ./RequiredModules.
Current behavior
RequiredModules files currently end up in the default location of./output/RequiredModules.
Suggested solution
Add Target parameter to the Invoke-PSDepend call as follows:
if (Test-Path -Path $DependencyFile)
{
$psDependParameters = @{
Force = $true
Path = $DependencyFile
Target = $PSDependTarget
}
# TODO: Handle when the Dependency file is in YAML, and -WithYAML is specified.
Invoke-PSDepend @psDependParameters
}
Operating system the target node is running
OsName : Microsoft Windows 10 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage : en-US
OsMuiLanguages : {en-US}
PowerShell version and build the target node is running
Name Value
---- -----
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Module version used
0.7.0 (latest)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in build.ps1 at the Invoke-PSDepend call and reproduce .\build.ps1 -ResolveDependency -RequiredModulesDirectory RequiredModules. Verify that the dependency target uses the requested directory and that the RequiredModules files are placed there rather than in output/RequiredModules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100