加载PowerShell控制台时出现以下错误”:
The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
所有配置文件位置均通过TestPath $PROFILE
和表示Powershell ISE配置文件的位置报告为false 。
PS C:\Windows\System32> Test-path $profile.AllUsersAllHosts
False
PS C:\Windows\System32> Test-path $profile.AllUsersCurrentHost
False
PS C:\Windows\System32> Test-path $profile.CurrentUserAllHosts
False
PS C:\Windows\System32> Test-path $profile.CurrentUserCurrentHost
False
PS C:\Windows\System32> Test-path "C:\Users\bleykekhman\Documents\WindowsPowerShell\Microsoft.PowerShelllSE_profile.psl"
False
PS C:\Windows\System32> Test-Path $PSHOME\Microsoft.PowerShelllSE_profile.ps1
False
我的问题是,如果我根本没有任何配置文件脚本,是什么导致错误消息?
因此,您已涵盖了验证是否没有要加载PowerShell的配置文件的重要基础。还有一个可以配置为加载代码的地方。我将检查您到PowerShell.exe的快捷方式,以查看是否有任何开关,如-File
和-NoExit
。
我确定我的捷径是香草,因为我刚刚重新安装了操作系统并将其更新为v4.0
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
%HOMEDRIVE%%HOMEPATH%
检查您的是否不同。
AnsgarWiechers从不同的角度提出了相同的建议。从cmd运行Powershell提示,没有任何开关。这将导致回到快捷方式。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句