GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - shadowcpy/powershell: A PowerShell Wrapper for Rust

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
devenv.lock
devenv.lock
 
 
devenv.nix
devenv.nix
 
 
devenv.yaml
devenv.yaml
 
 

Repository files navigation

WARNING

This crate was built in a short time for internal use. There are NO GUARANTEES MADE to security against command injection or other vulnerabilities. The crate was NOT AUDITED and should NEVER BE USED in externally accessible projects or with untrusted input.

Don't complain later that I didn't warn you!

powershell

powershell provides a Rust wrapper for Windows PowerShell. Command arguments are transferred as JSON, the final output is deserialized with Serde, and intermediate command results can be passed to later commands without converting them to text.

use powershell::{Outcome, Redact, powershell};

let sequence = powershell! {
    Vec<String>;
    @services = "Get-Service" {
        "Name" => Redact(vec!["ssh-agent", "WinRM"]),
    }
    "Select-Object" {
        "InputObject" => @services,
        "ExpandProperty" => "Name",
    }
};

match sequence.run()? {
    Outcome::Success(names) => println!("{names:?}"),
    Outcome::Failure(error) => eprintln!("PowerShell failed: {error}"),
}
# Ok::<(), powershell::errors::PowershellError>(())

The Redact wrapper only affects Debug and Display output. The original value is still serialized and sent to PowerShell.

Runtime requirements

Execution currently requires PowerShell 7 installed at its default 64-bit Windows path (C:\Program Files\PowerShell\7\pwsh.exe). Constructing, serializing, and formatting sequences does not invoke PowerShell.

License

This project is licensed under the GNU Affero General Public License v3.0.

About

A PowerShell Wrapper for Rust

Resources

Readme
AGPL-3.0 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.