新建Microsoft.PowerShell_profile.ps1 文件
New-Item -Type file -Force $profile
会在C:\Users\你的用户名\Documents\WindowsPowerShell文件夹里面生成该文件
在Microsoft.PowerShell_profile.ps1里面写入function与set-alias
function LoginTencent {
ssh 用户名@ip地址 -p ssh的端口号
}
set-alias logten LoginTencent
然后就可以在powershell里面使用logten命令登录服务器了。