ps-wrapper-creator

Generate .bat wrappers for PowerShell scripts to simplify command-line execution.

1|3|Updated Sep 23, 2022
One-click install
npx skills add https://github.com/xxthunder/shortcuts --skill ps-wrapper-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ps-wrapper-creator
Source: https://github.com/xxthunder/shortcuts/tree/main/.claude/skills/ps-wrapper-creator
Command: npx skills add https://github.com/xxthunder/shortcuts --skill ps-wrapper-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create .bat wrappers for PowerShell scripts to make them easily executable from the Windows command line, removing the need to remember pwsh command lines and handling execution policy manually.

Core Features & Use Cases

  • Generates a .bat wrapper in the same directory as the PowerShell script to enable one-click execution.
  • Supports PowerShell 7+ (pwsh) by default with guidance for compatibility with Windows PowerShell (powershell) when pwsh is unavailable.
  • Provides automated helpers (New-BatWrapper, New-BatWrappersForDirectory) to create wrappers for single scripts or entire directories.
  • Enables seamless usage with common tools and workflows (e.g., Keypirinha, standard CLI) by standardizing wrapper naming and behavior.

Quick Start

Use the ps-wrapper-creator tool to generate a .bat wrapper for your PowerShell script and gain one-click command-line execution.

Frequently Asked Questions about ps-wrapper-creator

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

FAQPage Schema
How do I run a PowerShell script from the command line without typing the full pwsh command?

To run a PowerShell script easily, you can generate a .bat wrapper that sits next to your .ps1 file. This wrapper handles the pwsh invocation and execution policy bypass automatically, enabling one-click execution from the Windows command line.

Can I create bat wrappers for all PowerShell scripts in a directory at once?

Yes, you can create bat wrappers for an entire directory using the New-BatWrappersForDirectory helper. This function automatically generates a .bat file next to every .ps1 script in the specified folder for bulk wrapper creation.

Does the bat wrapper support Windows PowerShell if pwsh is not installed?

Yes, the bat wrapper supports Windows PowerShell. It defaults to PowerShell 7+ (pwsh) but includes guidance and compatibility handling to use Windows PowerShell (powershell) when pwsh is unavailable on your system.

Why does my PowerShell script fail to execute due to execution policy on Windows?

PowerShell scripts often fail due to restrictive execution policies. A .bat wrapper bypasses this limitation by invoking the .ps1 script with the necessary policy bypass parameters, ensuring seamless command-line execution.

What is the best way to standardize PowerShell script execution for launcher tools like Keypirinha?

The best way to standardize execution is to generate .bat wrappers for your PowerShell scripts. This standardizes wrapper naming and behavior, allowing seamless integration and usage with common launcher tools and standard CLI workflows.