powershell报错:invalid command ‘hook’ Invoke-Expression : Cannot bind argument to parameter ‘Command’ because it is an empty string.
每次启动powershell,总会有这个错误出来,没报错截图,但在StackOverflow上找到一个几乎一样的报错(无答案,后面同步到StackOverflow):
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
invalid command 'hook'
Invoke-Expression : Cannot bind argument to parameter 'Command' because it is an empty string.
At \\INTRANET\AMER\User\0001\X\My Documents\WindowsPowerShell\profile.ps1:4 char:95
+ ... onda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:PSObject) [Invoke-Expression], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Invo
keExpressionCommand
网上几乎没答案,有人说可能是anaconda版本问题,所以直接试了一下升级(在anaconda prompt base中输入):
conda upgrade -n base -c defaults --override-channels conda
再打开powershell(版本是5.1.22000.282):
附(查看powershell版本):
$PSVersionTable