我经常使用
ii .在PowerShell中打开Windows资源管理器中的当前目录。这曾经一直有效,但现在什么也不会发生。
Invoke-Item cmdlet仍然有效。执行ii somefile.txt将在文本编辑器中打开该文件。但是目录不再工作了。
此外,start .不能工作。使用explorer .是可行的。
正在运行
Trace-Command -Name ParameterBinding {ii .} -PSHost返回
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Invoke-Item]
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Invoke-Item]
DEBUG: ParameterBinding Information: 0 : BIND arg [.] to parameter [Path]
DEBUG: ParameterBinding Information: 0 : Binding collection parameter Path: argument type [String], parameter type [System.String[]],
collection type Array, element type [System.String], no coerceElementType
DEBUG: ParameterBinding Information: 0 : Creating array with element type [System.String] and 1 elements
DEBUG: ParameterBinding Information: 0 : Argument type String is not IList, treating this as scalar
DEBUG: ParameterBinding Information: 0 : Adding scalar element of type String to array position 0
DEBUG: ParameterBinding Information: 0 : BIND arg [System.String[]] to param [Path] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND cmd line args to DYNAMIC parameters.
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Invoke-Item]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing正在运行
Trace-Command -Name CommandDiscovery {ii .} -PSHost返回
DEBUG: CommandDiscovery Information: 0 : Looking up command: ii
DEBUG: CommandDiscovery Information: 0 : Alias found: ii Invoke-Item
DEBUG: CommandDiscovery Information: 0 : Cmdlet found: Invoke-Item Microsoft.PowerShell.Commands.InvokeItemCommand,
Microsoft.PowerShell.Commands.Management, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35我猜可能存在文件关联问题或其他问题。但是我不知道Invoke-Item实际调用的是什么,或者如何更改它。
我怎么才能让它再次工作呢?
发布于 2012-04-13 21:06:03
很难弄清楚为什么它可能不再适用于您,但为什么不使用powershell和cmd中相同的替代方案:
start .( explorer .也适用)
如果ii .很重要,请尝试重新启动Powershell控制台和/或计算机。另外,试着做ii . -whatif,看看你是否得到了任何关于为什么它不再工作的线索。
https://stackoverflow.com/questions/10141357
复制相似问题