https://github.com/stopete/invokepowershellscript
This Windows Forms application is designed to streamline the execution of PowerShell scripts on remote Windows computers. It is particularly useful for system administrators and IT professionals who need to manage multiple machines across a network securely and efficiently.
https://github.com/stopete/invokepowershellscript
csharp git powershell remoteexecution
Last synced: 9 months ago
JSON representation
This Windows Forms application is designed to streamline the execution of PowerShell scripts on remote Windows computers. It is particularly useful for system administrators and IT professionals who need to manage multiple machines across a network securely and efficiently.
- Host: GitHub
- URL: https://github.com/stopete/invokepowershellscript
- Owner: stopete
- License: agpl-3.0
- Created: 2025-06-26T22:13:11.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-07-09T19:26:26.000Z (9 months ago)
- Last Synced: 2025-07-10T04:56:02.034Z (9 months ago)
- Topics: csharp, git, powershell, remoteexecution
- Language: C#
- Homepage:
- Size: 606 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Remote PowerShell Script Executor (Windows Forms App)
This Windows Forms application is designed to streamline the execution of PowerShell scripts on remote Windows computers.
It is particularly useful for system administrators and IT professionals who need to manage multiple machines across a network securely and efficiently.
---
## đ ī¸ Built With
- Visual Studio 2022
- C#
- PowerShell
---
## đĻ Requirements
- PowerShell 7
- Visual Studio 2022
- .NET Framework 4.8.1 Developer Pack (or greater)
- .NET 7.0
---
## đĨī¸ Application UI

- The left panel allows selecting files from predefined folders (`Computers` and `Scripts`).
- The right panel becomes active if you enable the checkbox **"Option to browse files"**.
- After selecting both a computer list and a script, click the red arrow button to execute.
- Output is shown in the application console.
---
## đ First-Time Setup
### 1. Configure Users
- Go to the application directory.
- Open `user.txt` and add users (e.g., `domain\adminuser`) who are authorized to run PowerShell scripts remotely.
### 2. Register Secret Vault
- Launch the app.
- Go to **Menu â Set up Vault**.
- Select a user from the dropdown (loaded from `user.txt`).
- Click **Go** to store the secret for that user.
> â
Example success message:
> `Secret 'domain\adminuser' stored successfully in vault 'domain\adminuser'.`
> âšī¸ *By default, the secret and vault use the same name. You can change this by editing `setvault.ps1`.*
### 3. Update `InvokeScript.ps1`
- Open `InvokeScript.ps1` in Notepad.
- Modify the following line with the vault and secret name you used:
```powershell
$cred = (Get-Secret -Vault domain\adminuser -Name domain\adminuser)
```
- Save and close the file.
---
## âļī¸ Running a Script
You have **two options** to select scripts and target machines:
### Option A: Predefined Folders
- Save PowerShell scripts to the `Scripts` folder.
- Save computer lists (`.txt` files) to the `Computers` folder.
### Option B: Manual Selection
- Enable the checkbox **"Option to browse files"**.
- Use the file pickers to load your script and computer list manually.
### Execution
- After selecting a script and computer list, click the **Run** button.
- The script will execute on the listed remote computers.
- Output will appear in the app console.
---
## đ Folder Structure
```
đ YourAppDirectory
âââ Scripts # Common PowerShell scripts
âââ Computers # Text files with target computer names
âââ user.txt # List of authorized users
âââ setvault.ps1 # Vault creation script
âââ InvokeScript.ps1
âââ YourApp.exe
```
---
## đ Security
Credentials are securely managed using the following PowerShell modules:
- `Microsoft.PowerShell.SecretManagement`
- `Microsoft.PowerShell.SecretStore`
---
## đŖ Notes
- Ensure `user.txt` is correctly populated before setting up the vault.
- Vault and secret names must match those referenced in `InvokeScript.ps1`.
---