cloudpups / cloudpups/authenticated-scripts
Execute Powershell script with powershell instead of pwsh
- Ngôn ngữ chính
- TypeScript
- Star
- 17
- Fork
- 6
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu với tasks/powershell/task.json tại logic lựa chọn lệnh được liên kết và tasks/powershell/execute-cli.ts, sau đó so sánh hành vi trên Windows với PowerShellV2 của Microsoft, powershell.ps1 và powershell.ts. Xác minh tham số pwsh và việc phát hiện Windows sẽ ảnh hưởng đến quá trình thực thi như thế nào, đồng thời xác nhận rằng cả các đường dẫn tác vụ trên Windows và không phải Windows đều hoạt động như dự kiến.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, powershell, typescript
- Lĩnh vực
- devops
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100