HI 大家下午好,之前一段時間部署實施上線lync企業語音,導緻暫停更新powershell系列博文,目前開始逐漸恢複。
在今後我會詳細講解一下關于windows server 2012 R2 中關于poweshell 帶給我們的驚喜。
好了直奔主題,今天我們來說說如何在ISE 3.0展示鍵盤快捷鍵的完整清單
其實所有快捷鍵都包含在的ISE Microsoft.PowerShell.GPowerShell 元件(DLL)
首先,我們需要得到一個參考該DLL。
1
2
3
4
5
6
7
<code>PS> </code><code>$gps</code> <code>= </code><code>$psISE</code><code>.GetType().Assembly</code>
<code>PS> </code><code>$gps</code>
<code> </code>
<code>GAC Version Location</code>
<code>--- ------- --------</code>
<code>True v4.0.30319 C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.GPowerShell\...</code>
<code> </code>
然後我們執行GetManifestResourceNames 來得到這個元件的所有資源清單
<code>PS> </code><code>$gps</code><code>.GetManifestResourceNames()</code>
<code> </code>
<code>Microsoft.PowerShell.GPowerShell.g.resources</code>
<code>GuiStrings.resources</code>
接下來我們建立一個ResourceManager對象的資源提供通路。名稱來顯示它的資源,我們要通路沒有資源擴充的該資源的元件。
<code>$rm</code> <code>= </code><code>New-Object</code> <code>System.Resources.ResourceManager GuiStrings,</code><code>$gps</code>
所有剩下的就是調用GetResourceSet()方法來檢索設定為一個特定的項目詳細
8
9
10
11
12
13
<code>$rs</code> <code>= </code><code>$rm</code><code>.GetResourceSet((</code><code>Get-Culture</code><code>),</code><code>$true</code><code>,</code><code>$true</code><code>)</code>
<code>$rs</code>
<code> </code>
<code>Name Value</code>
<code>---- -----</code>
<code>SnippetToolTipPath Path: {0}</code>
<code>MediumSlateBlueColorName Medium Slate Blue</code>
<code>EditorBoxSelectLineDownShor... Alt+Shift+Down ()</code>
<code>NewRunspace N_ew PowerShell Tab</code>
<code>EditorSelectToPreviousChara... Shift+Left()</code>
<code>RemoveAllBreakpointsShortcut Ctrl+Shift+F9()</code>
<code>SaveScriptQuestion Save {0}?</code>
<code>(...)</code>
我們看上面輸出的結果,我可以看到我标注的()突出顯示的項目值,類似的組合鍵。
如果看看我的輸出,你會發現項目的名稱結尾的“快捷方式” (帶或不帶結尾的數字),涉及到的功能鍵。
它們開始,後邊會跟一個數字或兩個“鍵盤”字,然後我們執行下面的一行代碼,我們可以過濾所有的鍵盤相關物項和整理出來。
<code>$rs</code> <code>| where Name </code><code>-match</code> <code>'Shortcut\d?$|^F\d+Keyboard'</code> <code>| </code><code>Sort-Object</code> <code>Value</code>
下面是完整的代碼片段和完整的結果
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<code>$gps</code> <code>= </code><code>$psISE</code><code>.GetType().Assembly</code>
<code>$rs</code> <code>| where Name </code><code>-match</code> <code>'Shortcut\d?$|^F\d+Keyboard'</code> <code>| </code><code>Sort-Object</code> <code>Value | </code><code>Format-Table</code> <code>-AutoSize</code>
<code> </code>
<code>Name Value</code>
<code>---- -----</code>
<code>EditorUndoShortcut2 Alt+Backspace</code>
<code>EditorSelectNextSiblingShortcut Alt+Down</code>
<code>ExitShortcut Alt+F4</code>
<code>EditorSelectEnclosingShortcut Alt+Left</code>
<code>EditorSelectFirstChildShortcut Alt+Right</code>
<code>EditorRedoShortcut2 Alt+Shift+Backspace</code>
<code>EditorBoxSelectLineDownShortcut Alt+Shift+Down</code>
<code>ToggleHorizontalAddOnPaneShortcut Alt+Shift+H</code>
<code>EditorBoxSelectToPreviousCharacterShortcut Alt+Shift+Left</code>
<code>EditorBoxSelectToNextCharacterShortcut Alt+Shift+Right</code>
<code>EditorTransposeLineShortcut Alt+Shift+T</code>
<code>EditorBoxSelectLineUpShortcut Alt+Shift+Up</code>
<code>ToggleVerticalAddOnPaneShortcut Alt+Shift+V</code>
<code>EditorSelectPreviousSiblingShortcut Alt+Up</code>
<code>ShowScriptPaneTopShortcut Ctrl+1</code>
<code>ShowScriptPaneRightShortcut Ctrl+2</code>
<code>ShowScriptPaneMaximizedShortcut Ctrl+3</code>
<code>EditorSelectAllShortcut Ctrl+A</code>
<code>ZoomIn1Shortcut Ctrl+Add</code>
<code>EditorMoveCurrentLineToBottomShortcut Ctrl+Alt+</code><code>End</code>
<code>EditorMoveCurrentLineToTopShortcut Ctrl+Alt+Home</code>
<code>EditorDeleteWordToLeftShortcut Ctrl+Backspace</code>
<code>StopExecutionShortcut Ctrl+</code><code>Break</code>
<code>StopAndCopyShortcut Ctrl+C</code>
<code>GoToConsoleShortcut Ctrl+D</code>
<code>EditorDeleteWordToRightShortcut Ctrl+Del</code>
<code>EditorScrollDownAndMoveCaretIfNecessaryShortcut Ctrl+Down</code>
<code>EditorMoveToEndOfDocumentShortcut Ctrl+</code><code>End</code>
<code>FindShortcut Ctrl+F</code>
<code>ShowCommandShortcut Ctrl+F1</code>
<code>CloseScriptShortcut Ctrl+F4</code>
<code>GoToLineShortcut Ctrl+G</code>
<code>ReplaceShortcut Ctrl+H</code>
<code>EditorMoveToStartOfDocumentShortcut Ctrl+Home</code>
<code>GoToEditorShortcut Ctrl+I</code>
<code>Copy2Shortcut Ctrl+Ins</code>
<code>ShowSnippetShortcut Ctrl+J</code>
<code>EditorMoveToPreviousWordShortcut Ctrl+Left</code>
<code>ToggleOutliningExpansionShortcut Ctrl+M</code>
<code>ZoomOut3Shortcut Ctrl+Minus</code>
<code>NewScriptShortcut Ctrl+N</code>
<code>OpenScriptShortcut Ctrl+O</code>
<code>GoToMatchShortcut Ctrl+Oem6</code>
<code>ZoomIn3Shortcut Ctrl+Plus</code>
<code>ToggleScriptPaneShortcut Ctrl+R</code>
<code>EditorMoveToNextWordShortcut Ctrl+Right</code>
<code>SaveScriptShortcut Ctrl+S</code>
<code>ZoomIn2Shortcut Ctrl+Shift+Add</code>
<code>GetCallStackShortcut Ctrl+Shift+D</code>
<code>EditorSelectToEndOfDocumentShortcut Ctrl+Shift+</code><code>End</code>
<code>RemoveAllBreakpointsShortcut Ctrl+Shift+F9</code>
<code>HideHorizontalAddOnToolShortcut Ctrl+Shift+H</code>
<code>EditorSelectToStartOfDocumentShortcut Ctrl+Shift+Home</code>
<code>ListBreakpointsShortcut Ctrl+Shift+L</code>
<code>EditorSelectToPreviousWordShortcut Ctrl+Shift+Left</code>
<code>ZoomOut4Shortcut Ctrl+Shift+Minus</code>
<code>StartPowerShellShortcut Ctrl+Shift+P</code>
<code>ZoomIn4Shortcut Ctrl+Shift+Plus</code>
<code>NewRemotePowerShellTabShortcut Ctrl+Shift+R</code>
<code>EditorSelectToNextWordShortcut Ctrl+Shift+Right</code>
<code>ZoomOut2Shortcut Ctrl+Shift+Subtract</code>
<code>EditorMakeUppercaseShortcut Ctrl+Shift+U</code>
<code>HideVerticalAddOnToolShortcut Ctrl+Shift+V</code>
<code>IntellisenseShortcut Ctrl+Space</code>
<code>ZoomOut1Shortcut Ctrl+Subtract</code>
<code>NewRunspaceShortcut Ctrl+T</code>
<code>EditorMakeLowercaseShortcut Ctrl+U</code>
<code>EditorScrollUpAndMoveCaretIfNecessaryShortcut Ctrl+Up</code>
<code>Paste1Shortcut Ctrl+V</code>
<code>CloseRunspaceShortcut Ctrl+W</code>
<code>Cut1Shortcut Ctrl+X</code>
<code>EditorRedoShortcut1 Ctrl+Y</code>
<code>EditorUndoShortcut1 Ctrl+Z</code>
<code>F1KeyboardDisplayName F1</code>
<code>HelpShortcut F1</code>
<code>StepOverShortcut F10</code>
<code>F10KeyboardDisplayName F10</code>
<code>StepIntoShortcut F11</code>
<code>F11KeyboardDisplayName F11</code>
<code>F12KeyboardDisplayName F12</code>
<code>F2KeyboardDisplayName F2</code>
<code>FindNextShortcut F3</code>
<code>F3KeyboardDisplayName F3</code>
<code>F4KeyboardDisplayName F4</code>
<code>RunScriptShortcut F5</code>
<code>F5KeyboardDisplayName F5</code>
<code>F6KeyboardDisplayName F6</code>
<code>F7KeyboardDisplayName F7</code>
<code>RunSelectionShortcut F8</code>
<code>F8KeyboardDisplayName F8</code>
<code>F9KeyboardDisplayName F9</code>
<code>ToggleBreakpointShortcut F9</code>
<code>EditorDeleteCharacterToLeftShortcut Shift+Backspace</code>
<code>Cut2Shortcut Shift+Del</code>
<code>EditorSelectLineDownShortcut Shift+Down</code>
<code>EditorSelectToEndOfLineShortcut Shift+</code><code>End</code>
<code>EditorInsertNewLineShortcut Shift+Enter</code>
<code>StepOutShortcut Shift+F11</code>
<code>FindPreviousShortcut Shift+F3</code>
<code>StopDebuggerShortcut Shift+F5</code>
<code>EditorSelectToStartOfLineShortcut Shift+Home</code>
<code>Paste2Shortcut Shift+Ins</code>
<code>EditorSelectToPreviousCharacterShortcut Shift+Left</code>
<code>EditorSelectPageDownShortcut Shift+PgDn</code>
<code>EditorSelectPageUpShortcut Shift+PgUp</code>
<code>EditorSelectToNextCharacterShortcut Shift+Right</code>
<code>EditorSelectLineUpShortcut Shift+Up</code>
看起來很多,其實隻需要記住幾個常用的即可。
本文轉自cantgis 51CTO部落格,原文連結:http://blog.51cto.com/cantgis/1301524,如需轉載請自行聯系原作者