PowerShell / PowerShell/PSScriptAnalyzer
What would be the correct TargetProfile for Ubuntu 20.04 runnin PSCore 7.1.3?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 2.2k
- Forks
- 414
- Merge medio
- 13 h 1 min
- PR fusionados (30 d)
- 2
Descripción
Reading the UseCompatibleCommands documentation, it says the TargetProfiles should follow the syntax:
<os-name>_<os-arch>_<os-version>_<ps-version>_<ps-arch>_<dotnet-version>_<dotnet-edition>
But it falls short on explaining how to get these values.
So, after a little bit of detective work and figuring out which framework version each PowerShell ships with, I come up with the following string:
ubuntu_x64_20.04_7.1.3_x64_5.0.220.61302_core
The most painful to figure out is the 5.0.220.61302 part which I assume is the dotnet-version PowerShell 7.1.3 ships with. Or does it matter?
Especially figuring out the build number is painful because the documentation on the referenced page don't go to explain if 5.0.2 is good enough or should I use the full version 5.0.220.61302.
It's not at all helpful that if I put 'dos_arm_6.1_9.9.9_x64_9999999999_goosfraba' into TargetProfiles, the Invoke-ScriptAnalyzer just merrily goes forward as if nothing happened.
- Is
ubuntu_x64_20.04_7.1.3_x64_5.0.220.61302_coregood for PSCore 7.1.3 running under Ubuntu 20.04? - Could you update the docs when new version of PowerShell is released? It could prove useful if my case was already in the docs so I could just copy/paste it.
- Would it at all be possible if
Invoke-ScriptAnalyzerwould produce at least a warning message when a profile string like'dos_arm_6.1_9.9.9_x64_9999999999_goosfraba'is passed to it?
Yes, the documentation says I could use PSCompatibilityCollector but when I go there, there's 0 documentation.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con RuleDocumentation/UseCompatibleCommands.md y la documentación de PSCompatibilityCollector a la que hace referencia. Verifica la sintaxis de TargetProfiles y los requisitos de versión para el ejemplo de Ubuntu y PowerShell; después, documenta los valores y aclara si los perfiles no válidos se rechazan o se ignoran. Se considera completado cuando la documentación responde a las preguntas del ejemplo y explica el comportamiento de los perfiles con un formato incorrecto.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- powershell
- Área
- documentation, tooling
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100