Skip to content

manujigo1264/Whisper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Whisper

A lightweight C++ utility for executing PowerShell scripts silently with error handling and process management.

Features

  • Unicode support for script paths
  • Silent process execution (no window display)
  • Exit code validation
  • Comprehensive error logging
  • Execution policy bypass capability

Usage

const std::wstring scriptPath = L"C:\\path\\to\\script.ps1";
if (RunPowerShellScript_Unicode(scriptPath)) {
    // Script executed successfully
} else {
    // Handle execution failure
}

Requirements

  • Windows OS
  • C++11 or later
  • Visual Studio 2022 (or compatible MSVC compiler)
  • Windows SDK

Building

Compile with standard Windows API libraries:

cl /EHsc main.cpp

How It Works

  1. Constructs a PowerShell command with execution policy bypass
  2. Creates a hidden process using CreateProcessW
  3. Waits for process completion
  4. Validates exit code
  5. Logs errors if applicable

Parameters

  • scriptPath: Full path to the PowerShell script file (.ps1)

Returns

  • true: Script executed with exit code 0
  • false: Execution failed or non-zero exit code

About

Silent PowerShell script executor for Windows with error handling and process management

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages