Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00
setup-cpp/packages/exec-powershell/README.md
2023-04-22 02:19:33 -07:00

61 lines
1.8 KiB
Markdown

<h1 align="center">exec-powershell</h1>
<p>
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
<a href="#" target="_blank">
<img alt="License: Apache--2.0" src="https://img.shields.io/badge/License-Apache--2.0-yellow.svg" />
</a>
</p>
> Run a powershell command.
## Install
```sh
npm install --save exec-powershell
```
## Usage
<!-- INSERT GENERATED DOCS START -->
### `execPowershell` (function)
Asynchronously execute a powershell command.
**Parameters:**
- command (`string`) - The powershell command to execute
- startupFlags (`string[]`) - The optional startup flags to be passed to powershell. Defaults to `["-NoProfile", "-NoLogo", "-NonInteractive"]`. This means that the Powershell profile is not sourced first.
- execOptions (`execa.Options`) - The options passed to `execa`. Defaults to `{ stdio: "inherit" }`
**returns:** execa.ExecaChildProcess<string>
### `execPowershellSync` (function)
Execute a powershell command.
**Parameters:**
- command (`string`) - The powershell command to execute
- startupFlags (`string[]`) - The optional startup flags to be passed to powershell. Defaults to `["-NoProfile", "-NoLogo", "-NonInteractive"]`. This means that the Powershell profile is not sourced first.
- execOptions (`execaSyncOptions`) - The options passed to `execa`. Defaults to `{ stdio: "inherit" }`
**returns:** execa.ExecaSyncReturnValue<string>
### `getPowerShell` (function)
Get the path to the powershell executable.
**returns:** string
<!-- INSERT GENERATED DOCS END -->
## 🤝 Contributing
You can sponsor my work here:
https://github.com/sponsors/aminya
Pull requests, issues and feature requests are welcome.
See the [Contributing guide](https://github.com/aminya/setup-cpp/blob/master/CONTRIBUTING.md).