使用PowerShell 7作为ssh客户端

使用PowerShell 7作为ssh客户端

编程文章jaq1232025-03-18 21:45:2116A+A-
https://learn.microsoft.com/zh-cn/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.4

Windows PowerShell 是微软发布的一种命令行外壳程序和脚本环境,使命令行用户和脚本编写者可以利用 .NET Framework的强大功能。Windows PowerShell与PowerShell 7并行运行,可便于你在部署前轻松地测试和比较各个版本。 迁移简单、快捷、安全。

PowerShell 7 是专为云、本地和混合环境设计的,它包含增强功能和新功能。

  • 与 Windows PowerShell 并行安装和运行
  • 提升了与现有 Windows PowerShell 模块的兼容性
  • 新语言功能(如三元运算符和 ForEach-Object -Parallel)
  • 提高了性能
  • 基于 SSH 的远程处理
  • 跨平台互操作性
  • 支持 Docker 容器

PowerShell 7下载链接:

https://github.com/PowerShell/PowerShell/releases

PowerShell 7基本设置

1) 设置默认启动

2) 设置配色方案

3) 修改字体

image
image

PowerShell 7中使用ssh登录服务器

PowerShell 7具有类似zsh的自动补全功能,在PowerShell 7命令行输入下面命令即可登录你的远程服务器:

ssh 用户名@IP

执行上面命令需要输入密码,密码正确即可登录远程服务器。可以通过设置免密登录,参考教程: https://tech.mindseed.cn/Linux/720.html。

点击这里复制本文地址 以上内容由jaq123整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!

苍茫编程网 © All Rights Reserved.  蜀ICP备2024111239号-21