cloudpups / cloudpups/authenticated-scripts

Execute Powershell script with powershell instead of pwsh

Abierto
#13 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
17
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

While playing around with my [fork](https://github.com/InwaySystems/authenticated-lcs-scripts), I noticed that the task for Powershell scripts executes them with Powershell 7 (pwsh.exe) on a Windows runner.

The following implicates that this should only happen when the `pwsh` parameter is true.
https://github.com/cloudpups/authenticated-scripts/blob/86b99c2b89c3202b31b6bcf05ad6658e43f86510/tasks/powershell/task.json#L121-L129

I believe this is a bug that was copied over from https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/PowerShellV2/powershell.ts, since both that logic and https://github.com/cloudpups/authenticated-scripts/blob/main/tasks/powershell/execute-cli.ts do not make use of the `pwsh` parameter. The Microsoft task is not affected by that bug, because it uses https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/PowerShellV2/powershell.ps1 when the task is executed on a Windows runner. That script considers the `pwsh` parameter.

I made a [change](https://github.com/InwaySystems/authenticated-lcs-scripts/commit/be56147821beb15386f958bd3c8105f6ec0b7d23) on my fork to address that issue, but it would require some additional work to bring it over to this repo (mainly to add logic to check if the task is running on Windows or not).

If there is interest for that, I can try creating a pull request.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Empieza por tasks/powershell/task.json en la lógica vinculada de selección de comandos y por tasks/powershell/execute-cli.ts; después compara el comportamiento de Windows con Microsoft PowerShellV2 powershell.ps1 y powershell.ts. Verifica cómo deberían afectar a la ejecución el parámetro pwsh y la detección de Windows, y confirma que las rutas de tareas tanto de Windows como de sistemas no Windows se comportan según lo previsto.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, powershell, typescript
Área
devops
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.