dotnet / dotnet/arcade

Cannot use pwsh local tool with arcade

Open
#14,532 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

The implementation of `ExitWithExitCode` means that we cannot use `pwsh` as a local tool in our repos. The implementation kills a number of processes, including `dotnet`. That means when you execute a script with `dotnet pwsh example.ps1` the `ExitWithExitCode` will kill itself.

Example:

```ps1
. "eng/common/tools.ps1"
$prepareMachine=$true
$ci=$true
ExitWithExitCode 0
```

Put that script in the root of a repo then execute it:

```cmd
E:\code\wt\ros3
⚡🔨 > dotnet pwsh .\example.ps1
Killing running build processes...
E:\code\wt\ros3
⚡🔨 > $LASTEXITCODE
-1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.