bazelisk
bazelisk copied to clipboard
Powershell wrapper does not run
I was trying to use a bazel wrapper on Windows, so I created tools/bazel.ps1 file in my project.
Trying to use that leads to this error:
2024/11/28 16:38:21 could not run Bazel: could not start Bazel: fork/exec D:\a\rules_sh\rules_sh\tests\tools\bazel.ps1: %1 is not a valid Win32 application.
It seems PowerShell scripts cannot be executed like native binaries; they need to be run through pwsh (PowerShell Core) or powershell (Windows PowerShell).
Using a bat wrapper for the wrapper works:
@echo off
pwsh -File "%~dp0tools\bazel_wrapper.ps1" %*