PowerCLI autocompletion for Notepad++
Notepad++ supports Powershell from version v5.6 but the VMware PowerCLI cmdlets aren’t included.
So I created PowerCLI Language definition file for syntax highlighting. It contains the cmdlets available in vSphere PowerCLI 4 Update 1 and vCenter Update Manager PowerCLI 4 Update 1.
1Add-PassthroughDevice
2Add-VMHost
3Add-VmHostNtpServer
4Apply-DrsRecommendation
5Apply-VMHostProfile
6Connect-VIServer
7Copy-DatastoreItem
8Copy-HardDisk
9Copy-VMGuestFile
10Disconnect-VIServer
11Dismount-Tools
12Export-VApp
13Export-VMHostProfile
14Get-Annotation
15Get-CDDrive
16Get-Cluster
17Get-CustomAttribute
18Get-Datacenter
19Get-Datastore
20Get-DrsRecommendation
21Get-DrsRule
22Get-FloppyDrive
23Get-Folder
24Get-HardDisk
25Get-Inventory
26Get-IScsiHbaTarget
27Get-Log
28Get-LogType
29Get-NetworkAdapter
30Get-NicTeamingPolicy
31Get-OSCustomizationNicMapping
32Get-OSCustomizationSpec
33Get-PassthroughDevice
34Get-PowerCLIConfiguration
35Get-PowerCLIVersion
36Get-ResourcePool
37Get-ScsiLun
38Get-ScsiLunPath
39Get-Snapshot
40Get-Stat
41Get-StatInterval
42Get-StatType
43Get-Task
44Get-Template
45Get-UsbDevice
46Get-VApp
47Get-VICredentialStoreItem
48Get-VIEvent
49Get-View
50Get-VIObjectByVIView
51Get-VIPermission
52Get-VIPrivilege
53Get-VIRole
54Get-VirtualPortGroup
55Get-VirtualSwitch
56Get-VM
57Get-VMGuest
58Get-VMGuestNetworkInterface
59Get-VMGuestRoute
60Get-VMHost
61Get-VMHostAccount
62Get-VMHostAdvancedConfiguration
63Get-VMHostAvailableTimeZone
64Get-VMHostDiagnosticPartition
65Get-VMHostFirewallDefaultPolicy
66Get-VMHostFirewallException
67Get-VMHostFirmware
68Get-VMHostHba
69Get-VMHostModule
70Get-VMHostNetwork
71Get-VMHostNetworkAdapter
72Get-VMHostNtpServer
73Get-VMHostProfile
74Get-VMHostService
75Get-VMHostSnmp
76Get-VMHostStartPolicy
77Get-VMHostStorage
78Get-VMHostSysLogServer
79Get-VMQuestion
80Get-VMResourceConfiguration
81Get-VMStartPolicy
82Import-VApp
83Import-VMHostProfile
84Install-VMHostPatch
85Invoke-VMScript
86Mount-Tools
87Move-Cluster
88Move-Datacenter
89Move-Folder
90Move-Inventory
91Move-ResourcePool
92Move-Template
93Move-VM
94Move-VMHost
95New-CDDrive
96New-Cluster
97New-CustomAttribute
98New-CustomField
99New-Datacenter
100New-Datastore
101New-DrsRule
102New-FloppyDrive
103New-Folder
104New-HardDisk
105New-IScsiHbaTarget
106New-NetworkAdapter
107New-OSCustomizationNicMapping
108New-OSCustomizationSpec
109New-ResourcePool
110New-Snapshot
111New-StatInterval
112New-Template
113New-VApp
114New-VICredentialStoreItem
115New-VIPermission
116New-VIRole
117New-VirtualPortGroup
118New-VirtualSwitch
119New-VM
120New-VMGuestRoute
121New-VMHostAccount
122New-VMHostNetworkAdapter
123New-VMHostProfile
124Remove-CDDrive
125Remove-Cluster
126Remove-CustomAttribute
127Remove-CustomField
128Remove-Datacenter
129Remove-Datastore
130Remove-DrsRule
131Remove-FloppyDrive
132Remove-Folder
133Remove-HardDisk
134Remove-Inventory
135Remove-IScsiHbaTarget
136Remove-NetworkAdapter
137Remove-OSCustomizationNicMap...
138Remove-OSCustomizationSpec
139Remove-PassthroughDevice
140Remove-ResourcePool
141Remove-Snapshot
142Remove-StatInterval
143Remove-Template
144Remove-UsbDevice
145Remove-VApp
146Remove-VICredentialStoreItem
147Remove-VIPermission
148Remove-VIRole
149Remove-VirtualPortGroup
150Remove-VirtualSwitch
151Remove-VM
152Remove-VMGuestRoute
153Remove-VMHost
154Remove-VMHostAccount
155Remove-VMHostNetworkAdapter Remove-VMHostNtpServer Remove-VMHostProfile
156Restart-VM Restart-VMGuest Restart-VMHost Restart-VMHostService
157Set-Annotation Set-CDDrive Set-Cluster Set-CustomAttribute
158Set-CustomField Set-Datacenter Set-Datastore Set-DrsRule Set-FloppyDrive
159Set-Folder Set-HardDisk Set-IScsiHbaTarget Set-NetworkAdapter
160Set-NicTeamingPolicy Set-OSCustomizationNicMapping
161Set-OSCustomizationSpec Set-PowerCLIConfiguration Set-ResourcePool
162Set-ScsiLun Set-ScsiLunPath Set-Snapshot Set-StatInterval Set-Template
163Set-VApp Set-VIPermission Set-VIRole Set-VirtualPortGroup
164Set-VirtualSwitch Set-VM Set-VMGuestNetworkInterface Set-VMGuestRoute
165Set-VMHost Set-VMHostAccount Set-VMHostAdvancedConfiguration
166Set-VMHostDiagnosticPartition Set-VMHostFirewallDefaultPolicy
167Set-VMHostFirewallException Set-VMHostFirmware Set-VMHostHba
168Set-VMHostModule Set-VMHostNetwork Set-VMHostNetworkAdapter
169Set-VMHostProfile Set-VMHostService Set-VMHostSnmp Set-VMHostStartPolicy
170Set-VMHostStorage Set-VMHostSysLogServer Set-VMQuestion
171Set-VMResourceConfiguration Set-VMStartPolicy Shutdown-VMGuest
172Start-VApp Start-VM Start-VMHost Start-VMHostService Stop-Task Stop-VApp
173Stop-VM Stop-VMHost Stop-VMHostService Suspend-VM Suspend-VMGuest
174Suspend-VMHost Test-VMHostProfileCompliance Test-VMHostSnmp Update-Tools
175Wait-Task Attach-Baseline Detach-Baseline Download-Patch Get-Baseline
176Get-Compliance Get-Patch Get-PatchBaseline New-PatchBaseline
177Remediate-Inventory Remove-Baseline Scan-Inventory Set-PatchBaseline
178Stage-Patch
179Answer-VMQuestion
180Get-ESX
181Get-PowerCLIDocumentation
182Get-VC Get-VIServer
183Get-VIToolkitConfiguration
184Get-VIToolkitVersion
185Set-VIToolkitConfiguration
To add PowerCLI as a user-defined language %APPDATA%Notepad++userDefineLang.xml and add the above configuration to this file.
Secondly I created a PowerCLI auto-completion file which contains the same PowerCLI cmdlets. This configuration needs to be added to C:Program FilesNotepad++pluginsAPIsPowerCLI.xml. The name of the auto-completion file needs to be the same as defined in the user-defined language definition file.
1<NotepadPlus>;
2<AutoComplete>
3<KeyWord name="Add-PassthroughDevice"/>
4<KeyWord name="Add-VMHost"/>
5<KeyWord name="Add-VmHostNtpServer"/>
6<KeyWord name="Answer-VMQuestion"/>
7<KeyWord name="Apply-DrsRecommendation"/>
8<KeyWord name="Apply-VMHostProfile"/>
9<KeyWord name="Attach-Baseline"/>
10<KeyWord name="Connect-VIServer"/>
11<KeyWord name="Copy-DatastoreItem"/>
12<KeyWord name="Copy-HardDisk"/>
13<KeyWord name="Copy-VMGuestFile"/>
14<KeyWord name="Detach-Baseline"/>
15<KeyWord name="Disconnect-VIServer"/>
16<KeyWord name="Dismount-Tools"/>
17<KeyWord name="Download-Patch"/>
18<KeyWord name="Export-VApp"/>
19<KeyWord name="Export-VMHostProfile"/>
20<KeyWord name="Get-Annotation"/>
21<KeyWord name="Get-Baseline"/>
22<KeyWord name="Get-CDDrive"/>
23<KeyWord name="Get-Cluster"/>
24<KeyWord name="Get-Compliance"/>
25<KeyWord name="Get-CustomAttribute"/>
26<KeyWord name="Get-Datacenter"/>
27<KeyWord name="Get-Datastore"/>
28<KeyWord name="Get-DrsRecommendation"/>
29<KeyWord name="Get-DrsRule"/>
30<KeyWord name="Get-ESX"/>
31<KeyWord name="Get-FloppyDrive"/>
32<KeyWord name="Get-Folder"/>
33<KeyWord name="Get-HardDisk"/>
34<KeyWord name="Get-IScsiHbaTarget"/>
35<KeyWord name="Get-Inventory"/>
36<KeyWord name="Get-Log"/>
37<KeyWord name="Get-LogType"/>
38<KeyWord name="Get-NetworkAdapter"/>
39<KeyWord name="Get-NicTeamingPolicy"/>
40<KeyWord name="Get-OSCustomizationNicMapping"/>
41<KeyWord name="Get-OSCustomizationSpec"/>
42<KeyWord name="Get-PassthroughDevice"/>
43<KeyWord name="Get-Patch"/>
44<KeyWord name="Get-PatchBaseline"/>
45<KeyWord name="Get-PowerCLIConfiguration"/>
46<KeyWord name="Get-PowerCLIDocumentation"/>
47<KeyWord name="Get-PowerCLIVersion"/>
48<KeyWord name="Get-ResourcePool"/>
49<KeyWord name="Get-ScsiLun"/>
50<KeyWord name="Get-ScsiLunPath"/>
51<KeyWord name="Get-Snapshot"/>
52<KeyWord name="Get-Stat"/>
53<KeyWord name="Get-StatInterval"/>
54<KeyWord name="Get-StatType"/>
55<KeyWord name="Get-Task"/>
56<KeyWord name="Get-Template"/>
57<KeyWord name="Get-UsbDevice"/>
58<KeyWord name="Get-VApp"/>
59<KeyWord name="Get-VC"/>
60<KeyWord name="Get-VICredentialStoreItem"/>
61<KeyWord name="Get-VIEvent"/>
62<KeyWord name="Get-VIObjectByVIView"/>
63<KeyWord name="Get-VIPermission"/>
64<KeyWord name="Get-VIPrivilege"/>
65<KeyWord name="Get-VIRole"/>
66<KeyWord name="Get-VIServer"/>
67<KeyWord name="Get-VIToolkitConfiguration"/>
68<KeyWord name="Get-VIToolkitVersion"/>
69<KeyWord name="Get-VM"/>
70<KeyWord name="Get-VMGuest"/>
71<KeyWord name="Get-VMGuestNetworkInterface"/>
72<KeyWord name="Get-VMGuestRoute"/>
73<KeyWord name="Get-VMHost"/>
74<KeyWord name="Get-VMHostAccount"/>
75<KeyWord name="Get-VMHostAdvancedConfiguration"/>
76<KeyWord name="Get-VMHostAvailableTimeZone"/>
77<KeyWord name="Get-VMHostDiagnosticPartition"/>
78<KeyWord name="Get-VMHostFirewallDefaultPolicy"/>
79<KeyWord name="Get-VMHostFirewallException"/>
80<KeyWord name="Get-VMHostFirmware"/>
81<KeyWord name="Get-VMHostHba"/>
82<KeyWord name="Get-VMHostModule"/>
83<KeyWord name="Get-VMHostNetwork"/>
84<KeyWord name="Get-VMHostNetworkAdapter"/>
85<KeyWord name="Get-VMHostNtpServer"/>
86<KeyWord name="Get-VMHostProfile"/>
87<KeyWord name="Get-VMHostService"/>
88<KeyWord name="Get-VMHostSnmp"/>
89<KeyWord name="Get-VMHostStartPolicy"/>
90<KeyWord name="Get-VMHostStorage"/>
91<KeyWord name="Get-VMHostSysLogServer"/>
92<KeyWord name="Get-VMQuestion"/>
93<KeyWord name="Get-VMResourceConfiguration"/>
94<KeyWord name="Get-VMStartPolicy"/>
95<KeyWord name="Get-View"/>
96<KeyWord name="Get-VirtualPortGroup"/>
97<KeyWord name="Get-VirtualSwitch"/>
98<KeyWord name="Import-VApp"/>
99<KeyWord name="Import-VMHostProfile"/>
100<KeyWord name="Install-VMHostPatch"/>
101<KeyWord name="Invoke-VMScript"/>
102<KeyWord name="Mount-Tools"/>
103<KeyWord name="Move-Cluster"/>
104<KeyWord name="Move-Datacenter"/>
105<KeyWord name="Move-Folder"/>
106<KeyWord name="Move-Inventory"/>
107<KeyWord name="Move-ResourcePool"/>
108<KeyWord name="Move-Template"/>
109<KeyWord name="Move-VM"/>
110<KeyWord name="Move-VMHost"/>
111<KeyWord name="New-CDDrive"/>
112<KeyWord name="New-Cluster"/>
113<KeyWord name="New-CustomAttribute"/>
114<KeyWord name="New-CustomField"/>
115<KeyWord name="New-Datacenter"/>
116<KeyWord name="New-Datastore"/>
117<KeyWord name="New-DrsRule"/>
118<KeyWord name="New-FloppyDrive"/>
119<KeyWord name="New-Folder"/>
120<KeyWord name="New-HardDisk"/>
121<KeyWord name="New-IScsiHbaTarget"/>
122<KeyWord name="New-NetworkAdapter"/>
123<KeyWord name="New-OSCustomizationNicMapping"/>
124<KeyWord name="New-OSCustomizationSpec"/>
125<KeyWord name="New-PatchBaseline"/>
126<KeyWord name="New-ResourcePool"/>
127<KeyWord name="New-Snapshot"/>
128<KeyWord name="New-StatInterval"/>
129<KeyWord name="New-Template"/>
130<KeyWord name="New-VApp"/>
131<KeyWord name="New-VICredentialStoreItem"/>
132<KeyWord name="New-VIPermission"/>
133<KeyWord name="New-VIRole"/>
134<KeyWord name="New-VM"/>
135<KeyWord name="New-VMGuestRoute"/>
136<KeyWord name="New-VMHostAccount"/>
137<KeyWord name="New-VMHostNetworkAdapter"/>
138<KeyWord name="New-VMHostProfile"/>
139<KeyWord name="New-VirtualPortGroup"/>
140<KeyWord name="New-VirtualSwitch"/>
141<KeyWord name="Remediate-Inventory"/>
142<KeyWord name="Remove-Baseline"/>
143<KeyWord name="Remove-CDDrive"/>
144<KeyWord name="Remove-Cluster"/>
145<KeyWord name="Remove-CustomAttribute"/>
146<KeyWord name="Remove-CustomField"/>
147<KeyWord name="Remove-Datacenter"/>
148<KeyWord name="Remove-Datastore"/>
149<KeyWord name="Remove-DrsRule"/>
150<KeyWord name="Remove-FloppyDrive"/>
151<KeyWord name="Remove-Folder"/>
152<KeyWord name="Remove-HardDisk"/>
153<KeyWord name="Remove-IScsiHbaTarget"/>
154<KeyWord name="Remove-Inventory"/>
155<KeyWord name="Remove-NetworkAdapter"/>
156<KeyWord name="Remove-OSCustomizationNicMap..."/>
157<KeyWord name="Remove-OSCustomizationSpec"/>
158<KeyWord name="Remove-PassthroughDevice"/>
159<KeyWord name="Remove-ResourcePool"/>
160<KeyWord name="Remove-Snapshot"/>
161<KeyWord name="Remove-StatInterval"/>
162<KeyWord name="Remove-Template"/>
163<KeyWord name="Remove-UsbDevice"/>
164<KeyWord name="Remove-VApp"/>
165<KeyWord name="Remove-VICredentialStoreItem"/>
166<KeyWord name="Remove-VIPermission"/>
167<KeyWord name="Remove-VIRole"/>
168<KeyWord name="Remove-VM"/>
169<KeyWord name="Remove-VMGuestRoute"/>
170<KeyWord name="Remove-VMHost"/>
171<KeyWord name="Remove-VMHostAccount"/>
172<KeyWord name="Remove-VMHostNetworkAdapter"/>
173<KeyWord name="Remove-VMHostNtpServer"/>
174<KeyWord name="Remove-VMHostProfile"/>
175<KeyWord name="Remove-VirtualPortGroup"/>
176<KeyWord name="Remove-VirtualSwitch"/>
177<KeyWord name="Restart-VM"/>
178<KeyWord name="Restart-VMGuest"/>
179<KeyWord name="Restart-VMHost"/>
180<KeyWord name="Restart-VMHostService"/>
181<KeyWord name="Scan-Inventory"/>
182<KeyWord name="Set-Annotation"/>
183<KeyWord name="Set-CDDrive"/>
184<KeyWord name="Set-Cluster"/>
185<KeyWord name="Set-CustomAttribute"/>
186<KeyWord name="Set-CustomField"/>
187<KeyWord name="Set-Datacenter"/>
188<KeyWord name="Set-Datastore"/>
189<KeyWord name="Set-DrsRule"/>
190<KeyWord name="Set-FloppyDrive"/>
191<KeyWord name="Set-Folder"/>
192<KeyWord name="Set-HardDisk"/>
193<KeyWord name="Set-IScsiHbaTarget"/>
194<KeyWord name="Set-NetworkAdapter"/>
195<KeyWord name="Set-NicTeamingPolicy"/>
196<KeyWord name="Set-OSCustomizationNicMapping"/>
197<KeyWord name="Set-OSCustomizationSpec"/>
198<KeyWord name="Set-PatchBaseline"/>
199<KeyWord name="Set-PowerCLIConfiguration"/>
200<KeyWord name="Set-ResourcePool"/>
201<KeyWord name="Set-ScsiLun"/>
202<KeyWord name="Set-ScsiLunPath"/>
203<KeyWord name="Set-Snapshot"/>
204<KeyWord name="Set-StatInterval"/>
205<KeyWord name="Set-Template"/>
206<KeyWord name="Set-VApp"/>
207<KeyWord name="Set-VIPermission"/>
208<KeyWord name="Set-VIRole"/>
209<KeyWord name="Set-VM"/>
210<KeyWord name="Set-VMGuestNetworkInterface"/>
211<KeyWord name="Set-VMGuestRoute"/>
212<KeyWord name="Set-VMHost"/>
213<KeyWord name="Set-VMHostAccount"/>
214<KeyWord name="Set-VMHostAdvancedConfiguration"/>
215<KeyWord name="Set-VMHostDiagnosticPartition"/>
216<KeyWord name="Set-VMHostFirewallDefaultPolicy"/>
217<KeyWord name="Set-VMHostFirewallException"/>
218<KeyWord name="Set-VMHostFirmware"/>
219<KeyWord name="Set-VMHostHba"/>
220<KeyWord name="Set-VMHostModule"/>
221<KeyWord name="Set-VMHostNetwork"/>
222<KeyWord name="Set-VMHostNetworkAdapter"/>
223<KeyWord name="Set-VMHostProfile"/>
224<KeyWord name="Set-VMHostService"/>
225<KeyWord name="Set-VMHostSnmp"/>
226<KeyWord name="Set-VMHostStartPolicy"/>
227<KeyWord name="Set-VMHostStorage"/>
228<KeyWord name="Set-VMHostSysLogServer"/>
229<KeyWord name="Set-VMQuestion"/>
230<KeyWord name="Set-VMResourceConfiguration"/>
231<KeyWord name="Set-VMStartPolicy"/>
232<KeyWord name="Set-VirtualPortGroup"/>
233<KeyWord name="Set-VirtualSwitch"/>
234<KeyWord name="Shutdown-VMGuest"/>
235<KeyWord name="Stage-Patch"/>
236<KeyWord name="Start-VApp"/>
237<KeyWord name="Start-VM"/>
238<KeyWord name="Start-VMHost"/>
239<KeyWord name="Start-VMHostService"/>
240<KeyWord name="Stop-Task"/>
241<KeyWord name="Stop-VApp"/>
242<KeyWord name="Stop-VM"/>
243<KeyWord name="Stop-VMHost"/>
244<KeyWord name="Stop-VMHostService"/>
245<KeyWord name="Suspend-VM"/>
246<KeyWord name="Suspend-VMGuest"/>
247<KeyWord name="Suspend-VMHost"/>
248<KeyWord name="Test-VMHostProfileCompliance"/>
249<KeyWord name="Test-VMHostSnmp"/>
250<KeyWord name="Update-Tools"/>
251<KeyWord name="Wait-Task "/>