powershell-core - 如何在 PowerShell 核心中创建永久别名文件?

标签 powershell-core

我正在尝试在 Windows 上从 PowerShell 5.1 转换到 PowerShell Core 7.0。在 PowerShell 中,我在 C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 处有一个永久别名文件。但是,当我启动核心终端时,不会加载这些别名。知道我可以做什么,以便在启动核心时也执行该文件吗?

最佳答案

添加 Mathias R. Jessen 的评论,以便该问题得到答案。

“将它们放入 Windows 上默认 PowerShell 7 的 $profile.AllUsersAllHosts 中,即 C:\Program Files\PowerShell\7\profile.ps1” – Mathias R .杰森

关于powershell-core - 如何在 PowerShell 核心中创建永久别名文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61081434/

相关文章:

powershell - 使用 Start-Process 保留环境变量

arrays - 为什么 PowerShell 将 `Where` 谓词应用于空列表

powershell - 本地 New-PSSession 在基于官方 powershell linux 的 docker 图像中失败

powershell - 为什么 PowerShell ISE 中的控制台不使用最新安装的 PowerShell 版本?

powershell - Powershell拆分未返回预期结果

powershell - 如何在 Ubuntu 18.04 上将 Powershell Core 更新到最新版本

linux - 自定义提示在 Ubuntu 上的 PowerShell Core 6.0 中打印两次

powershell - "true"弄乱了 Powershell 中的转义码处理?