Skip to content

nu::shell::io_error when trying to run file on windows #13020

@Araxeus

Description

@Araxeus

Describe the bug

When trying to run a powershell .ps1 script any file (except .bat) on windows, we get an error:

Error: nu::shell::io_error

  × I/O error
  help: %1 is not a valid Win32 application. (os error 193)

How to reproduce

  1. create a powershell .ps1 file containing anything, for example (Get-ChildItem).Count
  2. try to run it via nushell by calling the file name, for example ./childCount.ps1
  3. get error

Expected behavior

Run the powershell script and print the output

Screenshots

image

Configuration

key value
version 0.94.1
major 0
minor 94
patch 1
branch
commit_hash
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.78.0 (9b00956e5 2024-04-29)
rust_channel stable-x86_64-pc-windows-msvc
cargo_version cargo 1.78.0 (54d8815d0 2024-03-26)
build_time 2024-05-31 15:27:30 +03:00
build_rust_channel release
allocator mimalloc
features default, sqlite, system-clipboard, trash, which
installed_plugins

Additional context

I remember it used to work in some previous nushell version, but I might be wrong

  • pwsh -f ./childCount.ps1 obviously works
  • ./batscript.bat works

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions