启动时删除Powershell错误

时间:2016-11-30 11:25:46

标签: powershell posh-git

我尝试安装Posh-Git以使用带有Powershell的ssh。

我按照说明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时都停止显示此错误消息?

1 个答案:

答案 0 :(得分:10)

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

ORDER

或者您可以使用notepad $profile 查找您的个人资料,然后在那里编辑文件。

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