🤖 ChatGPT PowerShell Scripts 🚀
This repository contains two PowerShell scripts that allow you to interact with OpenAI's ChatGPT 🧠:
- ChatGPT-Conversation.ps1: Engage in a conversational manner with ChatGPT using a command-line interface.
- ChatGPT-One-Shot.ps1: Provide a rough email draft or message and receive a professionally written response in three different levels of formality.
Both scripts serve as simple examples on how to use ChatGPT's API with PowerShell.
⚙️ Requirements
- PowerShell
- An API key for OpenAI's API
🛠️ Setup
- Clone or download this repository to your local machine.
- Replace
<your API key>
in both scripts with your OpenAI API key 🔑.
🚀 Usage
ChatGPT-Conversation.ps1
- Open PowerShell and navigate to the folder containing the script 📁.
- Execute the script:
.\ChatGPT-Conversation.ps1
🖥️.
- You'll see a welcome message and a prompt to enter your question or command 🎤.
- Type your question or command and press Enter ⌨️.
- The AI will respond with its output 💬.
- To exit the script, type
exit
and press Enter 🚪.
- To reset the conversation and start a new one, type
reset
and press Enter 🔄.
ChatGPT-One-Shot.ps1
- Open PowerShell and navigate to the folder containing the script 📁.
- Execute the script:
.\ChatGPT-One-Shot.ps1
🖥️.
- Provide a rough email draft or message when prompted 📝.
- The AI will respond with three separate professionally written answers ranging from informal, formal, to business formal 💬.
- Press Enter to exit the script 🚪.
📖 Examples
ChatGPT-Conversation.ps1
ChatGPT-One-Shot.ps1
📝 Notes
The scripts initialize the AI with a default system message. You can change this message to set a different context for the AI by modifying the $AiSystemMessage variable.
ChatGPT-Conversation.ps1 will keep track of the conversation history, allowing the AI to provide context-aware answers.