You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspect the last error record and offer some suggestions on how to resolve it
.DESCRIPTION
Invoke-AIErrorHelper is a function that uses the OpenAI GPT-3 API to provide insights into errors that occur in a powershell script.
.EXAMPLE
Invoke-AIErrorHelper
#>
[CmdletBinding()]
[alias("ieh")]
param()
$lastError = $global:Error[0]
if ($null -ne $lastError) {
$message = $lastError.Exception.Message
$errorType = $lastError.FullyQualifiedErrorId
$promptPrefix = "Provide a detailed summary of the following powershell error and offer a potential powershell solution (using code if it's a confident solution):"