Skip to content

The application to execute does not exist : '/<script_path>/pwsh.dll'. When running script with shebang from bash with PS v7.3.0 installed #18510

@szymonos

Description

@szymonos

Prerequisites

Steps to reproduce

Create /tmp/test.ps1 script with shebang using the below code:

#!/usr/bin/pwsh
$true

Set the executable bit with chmod +x /tmp/test.ps1 command and run the script from bash shell on WSL/Linux with PowerShell v7.3.0 installed.

Expected behavior

$ /tmp/test.ps1
True

Actual behavior

$ /tmp/test.ps1
The application to execute does not exist: '/tmp/pwsh.dll'.

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Linux 5.15.68.1-microsoft-standard-WSL2 #1 SMP Mon Sep 19 19:14:52 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions