PowerShell / PowerShell/PSScriptAnalyzer
"Invoke-ScriptAnalyzer : The network path was not found" run time error thrown by PSSA
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
We are using PSSA as a PR policy for our repo, when the ps1 file has a code like this:
& "\\networkpath\\test.exe"
The Invoke-ScriptAnalyzer will throw a error like "Invoke-ScriptAnalyzer : The network path was not found"
The error will disappear if I change the code like this
$path = "\\networkpath\\test.exe"
& $path
I think PSSA should not check the networkpath, since .ps1 file will be running on a different environment other than dev environment. Also, this check seems not a rule in PSSA, but it caused a runtime error when calling Invoke-ScriptAnalyzer and this break our PR policy pipeline. Should PSSA not throw the error in such condition?
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 den beiden PowerShell-Snippets im Issue zu reproduzieren und ermittle, warum der direkte Aufruf des Netzwerkpfads ausgeführt oder validiert wird. Verfolge den Aufruf des Analyzers und die Behandlung von Laufzeitfehlern und überprüfe anschließend, dass die Analyse keinen Zugriff auf den Netzwerkpfad erfordert, während weiterhin die zutreffenden Diagnosen gemeldet werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100