2012-04-13 72 views
3

打開目錄,我經常使用Powershell的調用,項目不再工作在資源管理器

ii . 

在PowerShell中在Windows資源管理器打開當前目錄。這曾經一直工作,但現在沒有任何反應。

Invoke-Item小命令仍然有效。做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實際上是調用或如何改變它。

我怎樣才能得到這個工作了?

+0

是否'$ II仍然pwd'工作? – 2012-04-13 13:05:04

+0

還有一個標準問題 - 您是否嘗試過關閉電腦? :) – 2012-04-13 13:05:35

+0

@Shedal'ii $ pwd'不起作用。 – 2012-04-13 13:10:10

回答

2

這是非常艱難的弄清楚到底爲什麼它可能不會爲你工作了,但爲什麼不使用替代這是在PowerShell和CMD相同:

start . 

explorer .作品太)

如果ii .是很重要的,然後嘗試重新啓動PowerShell控制檯和/或計算機。也可以嘗試做ii . -whatif,看看你是否知道爲什麼它不工作了。

+0

通常是開始進程的別名嗎? – 2012-04-13 13:08:36

+0

@Christian - 你問我,因爲我說它在cmd中是一樣的嗎?你輸入的命令是相同的,但不是它們實際上是什麼。是的,啓動是Powershell中啓動進程的別名。 – manojlds 2012-04-13 13:09:33

+0

「開始」也不起作用。 '探險家。如果它歸結爲它我可以使用它,但我更喜歡'ii'的一致性。 – 2012-04-13 13:11:05

相關問題