ada-powershell-from-bash

Runs PowerShell scripts from git-bash/MSYS on Windows without variable expansion or path mangling.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/wubing7755/Ada --skill ada-powershell-from-bash-wubing7755
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ada-powershell-from-bash
Source: https://github.com/wubing7755/Ada/tree/main/skills/software-development/ada-powershell-from-bash
Command: npx skills add https://github.com/wubing7755/Ada --skill ada-powershell-from-bash-wubing7755

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running PowerShell from git-bash/MSYS on Windows fails in two recurring ways: bash silently expands $ variables in inlined PowerShell code, and MSYS path conversion strips backslashes from Windows paths like C:\Users\..., breaking script execution and CMake/Ninja invocations. ## Core Features & Use Cases - Two-step execution pattern: Write PowerShell code to a .ps1 file first, then run it with MSYS_NO_PATHCONV=1 powershell.exe -File to avoid both failure modes. - Path conversion guidance: Use forward slashes in -File arguments and cygpath -w to convert MSYS paths for CMake/Ninja variables like CMAKE_PREFIX_PATH. - Use Case: You are in a git-bash terminal on Windows and need to run a PowerShell script that references $env:USERPROFILE and a C:\ path. This Skill ensures the script executes correctly instead of failing with mangled variables and stripped backslashes. ## Quick Start Write your PowerShell code to a .ps1 file and execute it from git-bash with MSYS_NO_PATHCONV=1 powershell.exe -File using a forward-slash path.

Frequently Asked Questions about ada-powershell-from-bash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run PowerShell from git-bash on Windows?

Write the PowerShell code to a .ps1 file first, then execute it with MSYS_NO_PATHCONV=1 powershell.exe -ExecutionPolicy Bypass -File using a forward-slash path like 'C:/Users/World/script.ps1'. Never inline PowerShell containing $ variables directly in bash commands.

Why does PowerShell fail when inlined in a bash command?

Bash treats $ as variable expansion, so PowerShell syntax like $env:USERPROFILE, $_.Name, or $(...) gets mangled before reaching powershell.exe. Writing the code to a .ps1 file first avoids bash interpretation entirely.

Why do Windows paths lose backslashes in git-bash?

MSYS automatically converts strings that look like paths, turning C:\Users\World\script.ps1 into C:UsersWorldscript.ps1. Prefix commands with MSYS_NO_PATHCONV=1 and use forward slashes in the -File argument to prevent this.

How do I pass Windows paths to CMake or Ninja from MSYS?

Use cygpath -w to convert Unix-style paths like /c/Users/... into Windows-native paths before passing them to CMake variables such as CMAKE_PREFIX_PATH, -S, -B, or install prefixes. Otherwise Ninja generators may fail to resolve the paths.

When should I not use this PowerShell-from-bash pattern?

Skip it when you are already in a native PowerShell session, since the bash expansion and MSYS path issues do not apply. It is also irrelevant for Linux or macOS shell scripting and non-Windows environments.