首先使用 Test-Path $profile
查看是否有 profile 文件, 如果显示 flase 则执行2
New-Item -path $profile -itemtype file -Force
返回一个目录,去打开编辑这个文件
文件添加
function suser {ssh user@10.1.1.100}
打开一个管理员模式的 power shell 执行 Set-Executionpolicy Remotesigned
重新打开一个 power shell, 别名即可使用
网友评论