forked from PowerShell/AIShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAIShell.psm1
More file actions
16 lines (13 loc) · 750 Bytes
/
Copy pathAIShell.psm1
File metadata and controls
16 lines (13 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if ($IsMacOS -and $env:TERM_PROGRAM -ne "iTerm.app") {
throw "The AIShell module requires iTerm2 to work properly. Please install and run from the iTerm2 terminal."
}
$module = Get-Module -Name PSReadLine
if ($null -eq $module -or $module.Version -lt [version]"2.4.2") {
throw "The PSReadLine v2.4.2-beta2 or higher is required for the AIShell module to work properly."
}
$runspace = $Host.Runspace
if ($null -eq $runspace) {
throw "Failed to import the module because '`$Host.Runspace' unexpectedly returns null.`nThe host details:`n$($Host | Out-String -Width 120)"
}
## Create the channel singleton when loading the module.
$null = [AIShell.Integration.Channel]::CreateSingleton($runspace, [Microsoft.PowerShell.PSConsoleReadLine])