pwsh_shortcut_alias
pwsh_shortcut_alias
Section titled “pwsh_shortcut_alias”pwsh_shortcut_alias 是一个 PowerShell 模块,用于管理快捷方式别名。通过该模块,你可以轻松为常用程序或脚本创建别名,通过别名快速启动对应程序,并支持添加、删除、搜索和更新操作。
项目地址:pwsh_shortcut_alias
- 为常用程序或脚本创建快捷方式别名
- 支持别名添加、删除、搜索(模糊搜索)和更新
- 别名信息存储在 YAML 文件中,模块可跨会话使用
- 一键更新所有别名,自动注册为全局函数
- 支持 PowerShell 7+,依赖
powershell-yaml模块解析 YAML 文件
- 安装
- 卸载
- 将模块文件夹
pwsh_shortcut_alias复制到 PowerShell 模块目录,例如:
- 导入模块:
- 在 PowerShell profile 添加如下内容,使用 notepad $PROFILE 快速编辑:
Use-ShortcutAlias 的别名为 usa。
搜索别名(模糊搜索)
Section titled “搜索别名(模糊搜索)”更新所有别名
Section titled “更新所有别名”使用别名启动程序
Section titled “使用别名启动程序”- 模块在第一次使用时会自动生成
shortcout_aliases.yaml文件,用于存储别名信息:
- PowerShell 7+ 或 Windows PowerShell
powershell-yaml模块:
- 别名名称必须唯一
Use-ShortcutAlias update会将 YAML 文件中所有别名注册为全局函数- 使用别名前确保
Use-ShortcutAlias update已执行,否则函数可能未注册
MIT License