首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Powershell Invoke-Item不再用于在资源管理器中打开目录

Powershell Invoke-Item不再用于在资源管理器中打开目录
EN

Stack Overflow用户
提问于 2012-04-13 21:02:43
回答 1查看 1.3K关注 0票数 3

我经常使用

代码语言:javascript
复制
ii .

在PowerShell中打开Windows资源管理器中的当前目录。这曾经一直有效,但现在什么也不会发生。

Invoke-Item cmdlet仍然有效。执行ii somefile.txt将在文本编辑器中打开该文件。但是目录不再工作了。

此外,start .不能工作。使用explorer .是可行的。

正在运行

代码语言:javascript
复制
Trace-Command -Name ParameterBinding {ii .} -PSHost

返回

代码语言:javascript
复制
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

正在运行

代码语言:javascript
复制
Trace-Command -Name CommandDiscovery {ii .} -PSHost

返回

代码语言:javascript
复制
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实际调用的是什么,或者如何更改它。

我怎么才能让它再次工作呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-04-13 21:06:03

很难弄清楚为什么它可能不再适用于您,但为什么不使用powershell和cmd中相同的替代方案:

代码语言:javascript
复制
start .

( explorer .也适用)

如果ii .很重要,请尝试重新启动Powershell控制台和/或计算机。另外,试着做ii . -whatif,看看你是否得到了任何关于为什么它不再工作的线索。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10141357

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档