PowerShell | Add pythons
This commit is contained in:
parent
a0e11cbdc3
commit
8729591478
@ -19,6 +19,16 @@ Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
|
|||||||
# 设置向下键为前向搜索历史纪录
|
# 设置向下键为前向搜索历史纪录
|
||||||
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
|
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
|
||||||
|
|
||||||
|
function pythons {
|
||||||
|
(8, 9, 10, 11, 12) | ForEach-Object {
|
||||||
|
if ($args.Count -eq 0) {
|
||||||
|
Invoke-Expression "python3.$_ -c 'import sys;print(sys.version)'"
|
||||||
|
} else {
|
||||||
|
Invoke-Expression "python3.$_ $args"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# 如果是 windows 平台 则执行 windows 下的配置
|
# 如果是 windows 平台 则执行 windows 下的配置
|
||||||
|
|
||||||
if ($IsWindows) {
|
if ($IsWindows) {
|
||||||
|
Loading…
Reference in New Issue
Block a user