这篇文章上次修改于 2060 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

powsershell 创建alias

1.首先保证.profile 是存在的

New-Item –Path $Profile –Type File –Force

2.创建函数和别名

function Do-ActualThing {
    # do actual thing
}

Set-Alias MyAlias Do-ActualThing

3.重启powershell