-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize our Powershell code #72423
Conversation
@dotnet/roslyn-infrastructure PTAL |
# DO | ||
Exec-Command $command $args | ||
& eng/make-bootstrap.ps1 | ||
Test-LastExitCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was wrong with Exec-Script
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is very difficult to pass switch based values between scripts with Exec-Script
and Powershell. For example the following is tricky:
Exec-Script "eng/build.ps1" "-ci:$ci"
That turns into -ci:true
which isn't a valid Powershell calling syntax.
Co-authored-by: Jan Jones <jan.jones.cz@gmail.com>
Not sure why AzDO got disconnected from the PR but here is the build with all passing tests https://dnceng-public.visualstudio.com/public/_build/results?buildId=593595&view=results |
In #72341 I made an attempt to standardize our Powershell on pwsh. Unfortunately attempting to get that PR green revealed a number of issues and in following up on those issues with core-eng I came to the conclusion that it's not possible to move fully to pwsh at this time. The issue is that there are downstream consumers of our repo that use Powershell and they have no plans to move hence moving here will just end up breaking source build, unified build, etc ...
As a result I went through our code and removed all of the existing pwsh usage. I also took the time to update our Powershell Guidelines document to enforce using Powershell as well as a few other items. Then I went through our Powershell scripts and ensured they conformed to these guidelines.
The one place that remains able to usee pwsh is our VSCode supporting scripts as that is not part of our build infra.