https://github.com/JeffBrownTech/powershell-prompts
Examples of how to create user prompts in PowerShell
https://github.com/JeffBrownTech/powershell-prompts
Last synced: 4 months ago
JSON representation
Examples of how to create user prompts in PowerShell
- Host: GitHub
- URL: https://github.com/JeffBrownTech/powershell-prompts
- Owner: JeffBrownTech
- Created: 2020-03-25T12:49:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-07T14:44:58.000Z (about 5 years ago)
- Last Synced: 2024-08-14T07:07:14.568Z (8 months ago)
- Language: PowerShell
- Size: 4.88 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - JeffBrownTech/powershell-prompts - Examples of how to create user prompts in PowerShell (PowerShell)
README
# powershell-prompts
This repository holds examples of how to create prompts inside the PowerShell console window.
To learn more about creating PowerShell prompts, check out my blog posts on the subject:
[How to Create Prompts in PowerShell](https://www.jeffbrown.tech/post/how-to-create-prompts-in-powershell)
[Creating Graphical Prompts Inside PowerShell](https://www.jeffbrown.tech/post/creating-graphical-prompts-inside-powershell)
## PromptMethod-Manual.ps1
This script holds an example function using what I call a "manual" method of creating a prompt, meaning more effort is put into creating help text and matching the color scheme of a regular PowerShell prompt.## PromptMethod-dotNET.ps1
This script holds an example function using .NET Framework classes in order to create a prompt. The code is much cleaner and automatically includes logic for displaying help text and matching color schemes.## PromptMethod-Graphical.ps1
This scripts holds an example function using .NET Framework classes to create a graphical prompt. The logic to create the prompt is located in the New-YesNoPrompt function, which is called by the Remove-MyItem function to prompt the user to remove the file or not.