Skip to content

Bug: Run with PowerShell doesn't use scripts location as working directory #16811

@Jack251970

Description

@Jack251970

Description

When I use system Explorer to run this powershell file with Run with Powershell Context Menu Item, it works well.

Image

But when I use Files to run powershell file with Run with Powershell Context Menu Item, I encounter this issue.

Image

These are the contents of my ps1 file and I just want to run one dotnet run task.

dotnet run --project build/Build.csproj
exit $LASTEXITCODE;

Related file tree is like that:

  • build.ps1
    • build/Build,csproj

Steps To Reproduce

  1. Create one VS project.
  2. Create ps1 file for it.
  3. Run this ps1 file.

Files Version

3.9.1.0

Windows Version

10.0.26100.3194

User ID

a2edf6d2-76d7-4004-bceb-5cd7ffa27d13

Log File

debug.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions