diff --git a/PowerShell/Microsoft.PowerShell_profile.ps1 b/PowerShell/Microsoft.PowerShell_profile.ps1 index f205fa3..062e7da 100644 --- a/PowerShell/Microsoft.PowerShell_profile.ps1 +++ b/PowerShell/Microsoft.PowerShell_profile.ps1 @@ -19,6 +19,16 @@ Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward # 设置向下键为前向搜索历史纪录 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 下的配置 if ($IsWindows) {