Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjrobinson/539c0736e9a95d9bb9d7570f19f48bb8 to your computer and use it in GitHub Desktop.
Save darrenjrobinson/539c0736e9a95d9bb9d7570f19f48bb8 to your computer and use it in GitHub Desktop.
Simplified Set PowerShellAI OpenAI API Credentials Securely on Windows. Associated blogpost https://blog.darrenjrobinson.com/generative-ai-chatgpt-with-powershell/
# 1. Import the OpenAI API Key from the local securely exported credential
$chatGPTCred = Import-Clixml .\chatGPTAPIKey.xml
# 2. Use the Set-OpenAIKey cmdlet to take the secure credential and set the OpenAIKey environment variable
Set-OpenAIKey -Key $chatGPTCred.Password
# 3. Import the PowerShellAI Module
Import-Module PowerShellAI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment