powershell - 消除启动时的Powershell错误

标签 powershell posh-git

我尝试安装Posh-Git以将ssh与Powershell结合使用。

我按照指示here

此处的文件未进行数字签名,因此我更改了执行策略以进行安装。然后,我(出于任何原因)决定不使用此文件,因此删除了该文件。

现在,每当启动Powershell时,都会出现类似于以下的错误:

The term 'C:\xxx\xxx\profile.example.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program.

如何停止每次启动Powershell时出现此错误消息?

最佳答案

您需要编辑PowerShell配置文件并从那里删除该行。最简单的方法是(在PowerShell中):

notepad $profile

或者,您也可以使用$profile查找个人资料,然后在其中编辑文件。

请查阅此内容以进一步阅读:https://blogs.technet.microsoft.com/heyscriptingguy/2012/05/21/understanding-the-six-powershell-profiles/

关于powershell - 消除启动时的Powershell错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40887158/

相关文章:

python - 创建 Windows 10 桌面快捷方式以在 venv 虚拟环境中运行 python 脚本

sharepoint - 功能激活

powershell - Oh-my-posh 主题与 Powerline 字体和 ConEmu 无法正常工作

Powershell Format-Table 导致空列

c# - Windows Powershell SDK 和 System.Management.Automation.PSObject

powershell - 在 Visual Studio 包管理器中安装 posh-git

powershell - 术语 'Install-Module' 未被识别为 cmdlet 的名称

PowerShell 使用 Invoke-Command 创建 IE 的远程实例

powershell - 如何从自定义 shell 使用 GitHub for Windows 附带的 posh-git?