-
Notifications
You must be signed in to change notification settings - Fork 0
/
ipython.ps1
33 lines (32 loc) · 921 Bytes
/
ipython.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## PVM: Python version manager
## by viki
##
## See readme.md!
##
$PVM_SCRIPT_ROOT = ""
Try
{
$PVM_SCRIPT_ROOT = Get-Variable -Name PSScriptRoot -ValueOnly -ErrorAction Stop
}
Catch
{
$PVM_SCRIPT_ROOT = Split-Path $script:MyInvocation.MyCommand.Path
}
$scriptPath = Join-Path $PVM_SCRIPT_ROOT "__pvm_do_not_use_it_directly.ps1"
$argumentList = $PsBoundParameters.Values + $args
$processedArgs = [System.Collections.ArrayList]@()
for($i=0; $i -lt $argumentList.Count; $i++)
{
# Write-Host "Arguments $i : " $argumentList[$i]
if ($argumentList[$i] -match "\s")
{
$null = $processedArgs.Add('"{0}"' -f $argumentList[$i])
}
else
{
$null = $processedArgs.Add($argumentList[$i])
}
}
# Write-Host "Input argumentList: $processedArgs"
$env:PVM_TARGET_APP = 'ipython'; Invoke-Expression "& `"$scriptPath`" $processedArgs"