PowerShell / PowerShell/PSScriptAnalyzer
-SaveDscDependency does not work on Microsoft-hosted 'ubuntu-latest' agents
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 414
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, Invoke-ScriptAnalyzer mit -SaveDscDependency auf einem von Microsoft gehosteten ubuntu-latest-Agenten auszuführen und vergleiche das Ergebnis mit windows-latest, wobei du die gemeldeten DSC-Module und RestrictRDPForLocalAccounts.ps1 verwendest. Erledigt ist die Aufgabe, wenn die DSC-Module heruntergeladen wurden und die Skriptdateien ohne die gemeldeten Analysefehler gescannt werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- cli, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100