Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

gnomejs/powershell

Repository files navigation

@gnome/env

logo Work less. Do more.

Overview

The powershell module provides a simple way to execute PowerShell scripts or files.

The module relies upon the @gnome/exec module and has the same basic usage as the Command and ShellCommand class.

Basic Usage

import { powershell } from "@gnome/powershell";

const cmd = await powershell("Write-Host 'Hello, World!'", { 
        stdout: 'piped', 
        stderr: 'piped'
    });
console.log(await cmd.text());
console.log(cmd.code);

console.log(await powershell("Write-Host 'Hello, World!'").text());

console.log(await powershell("test.ps1").text()); 

// runs powershell command and writes directly to console
await powershell("Write-Host 'I am alive'").run();

MIT License

About

The powershell module lets you simply execute scripts or files for PowerShell on windows.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors