PowerShell / PowerShell/PSScriptAnalyzer
-SaveDscDependency does not work on Microsoft-hosted 'ubuntu-latest' agents
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Steps to reproduce
Invoke-ScriptAnalyzer -Path . -Recurse -ReportSummary -SaveDscDependency -EnableExit
We have some new scripts which rely on DSC modules (for example 'nxtools', 'PSDscResources' and 'SecurityPolicyDSC'). RestrictRDPForLocalAccounts.ps1 is one of the PowerShell script files that used DSC modules. While executing the PSScriptAnalyzer scan with the -SaveDscDependency option on the Microsoft-hosted 'ubuntu-latest' agents in our CI/CD pipeline, the DSC modules are not saved:
The same command works fine on Microsoft-hosted 'windows-latest' agents:
Expected behavior
The DSC modules are downloaded and the script files are scanned the same way as on Windows.
Actual behavior
The DSC modules are not downloaded and the scan list parse errors.
Environment data
Microsoft-hosted 'ubuntu-latest' agents
PowerShell 7.4.7
PSScriptAnalyzer: 1.24.0
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 by running Invoke-ScriptAnalyzer with -SaveDscDependency on a Microsoft-hosted ubuntu-latest agent and compare it with windows-latest, using the reported DSC modules and RestrictRDPForLocalAccounts.ps1. Done means the DSC modules are downloaded and the script files scan without the reported parse errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100