voidint / g

Golang Version Manager
https://pkg.go.dev/github.com/voidint/g
MIT License
1.92k stars 209 forks source link

windows 安装报错 #130

Open SuSuSoo opened 8 months ago

SuSuSoo commented 8 months ago

PS C:\Users\Bagayal> iwr https://raw.githubusercontent.com/voidint/g/master/install.ps1 -useb | iex
iex : 所在位置 行:9 字符: 30
+ $base_dir = $base_dir -eq "" ? ($env:G_HOME ? $env:G_HOME : "$HOME\.g ...
+                              ~
表达式或语句中包含意外的标记“?”。
所在位置 行:9 字符: 45
+ $base_dir = $base_dir -eq "" ? ($env:G_HOME ? $env:G_HOME : "$HOME\.g ...
+                                             ~
表达式或语句中包含意外的标记“?”。
所在位置 行:9 字符: 44
+ $base_dir = $base_dir -eq "" ? ($env:G_HOME ? $env:G_HOME : "$HOME\.g ...
+                                            ~
表达式中缺少右“)”。
所在位置 行:9 字符: 71
+ ... = $base_dir -eq "" ? ($env:G_HOME ? $env:G_HOME : "$HOME\.g") : $base ...
+                                                                 ~
表达式或语句中包含意外的标记“)”。
所在位置 行:1 字符: 76
+ ... ://raw.githubusercontent.com/voidint/g/master/install.ps1 -useb | iex
+                                                                       ~~~
    + CategoryInfo          : ParserError: (:) [Invoke-Expression], ParseException
    + FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand
voidint commented 8 months ago

@akayj 帮忙看下

guokun1998 commented 8 months ago

三元运算符在powershell 7中引入 https://learn.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_if?view=powershell-7.4 我的默认5.1 会报这个错误 更新方法: https://learn.microsoft.com/zh-cn/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#winget