PowerShell | Add pythons

This commit is contained in:
shenjack 2023-10-21 02:01:56 +08:00
parent a0e11cbdc3
commit 8729591478
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -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) {