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.

Add-PassthroughDevice 
Add-VMHost
Add-VmHostNtpServer 
Apply-DrsRecommendation 
Apply-VMHostProfile
Connect-VIServer 
Copy-DatastoreItem 
Copy-HardDisk 
Copy-VMGuestFile
Disconnect-VIServer 
Dismount-Tools 
Export-VApp 
Export-VMHostProfile
Get-Annotation 
Get-CDDrive
Get-Cluster 
Get-CustomAttribute
Get-Datacenter 
Get-Datastore 
Get-DrsRecommendation 
Get-DrsRule
Get-FloppyDrive 
Get-Folder 
Get-HardDisk 
Get-Inventory 
Get-IScsiHbaTarget
Get-Log 
Get-LogType 
Get-NetworkAdapter 
Get-NicTeamingPolicy
Get-OSCustomizationNicMapping 
Get-OSCustomizationSpec
Get-PassthroughDevice 
Get-PowerCLIConfiguration 
Get-PowerCLIVersion
Get-ResourcePool 
Get-ScsiLun 
Get-ScsiLunPath 
Get-Snapshot 
Get-Stat
Get-StatInterval 
Get-StatType
Get-Task 
Get-Template 
Get-UsbDevice
Get-VApp 
Get-VICredentialStoreItem 
Get-VIEvent 
Get-View
Get-VIObjectByVIView 
Get-VIPermission 
Get-VIPrivilege 
Get-VIRole
Get-VirtualPortGroup 
Get-VirtualSwitch 
Get-VM 
Get-VMGuest
Get-VMGuestNetworkInterface 
Get-VMGuestRoute 
Get-VMHost
Get-VMHostAccount 
Get-VMHostAdvancedConfiguration
Get-VMHostAvailableTimeZone 
Get-VMHostDiagnosticPartition
Get-VMHostFirewallDefaultPolicy 
Get-VMHostFirewallException
Get-VMHostFirmware 
Get-VMHostHba 
Get-VMHostModule 
Get-VMHostNetwork
Get-VMHostNetworkAdapter 
Get-VMHostNtpServer 
Get-VMHostProfile
Get-VMHostService 
Get-VMHostSnmp 
Get-VMHostStartPolicy 
Get-VMHostStorage
Get-VMHostSysLogServer 
Get-VMQuestion 
Get-VMResourceConfiguration
Get-VMStartPolicy 
Import-VApp 
Import-VMHostProfile 
Install-VMHostPatch
Invoke-VMScript 
Mount-Tools 
Move-Cluster 
Move-Datacenter
Move-Folder
Move-Inventory 
Move-ResourcePool 
Move-Template 
Move-VM
Move-VMHost
New-CDDrive 
New-Cluster
New-CustomAttribute 
New-CustomField
New-Datacenter 
New-Datastore 
New-DrsRule 
New-FloppyDrive 
New-Folder
New-HardDisk 
New-IScsiHbaTarget 
New-NetworkAdapter
New-OSCustomizationNicMapping 
New-OSCustomizationSpec
New-ResourcePool
New-Snapshot 
New-StatInterval 
New-Template 
New-VApp
New-VICredentialStoreItem 
New-VIPermission 
New-VIRole
New-VirtualPortGroup 
New-VirtualSwitch 
New-VM 
New-VMGuestRoute
New-VMHostAccount 
New-VMHostNetworkAdapter 
New-VMHostProfile
Remove-CDDrive 
Remove-Cluster 
Remove-CustomAttribute 
Remove-CustomField
Remove-Datacenter 
Remove-Datastore 
Remove-DrsRule 
Remove-FloppyDrive
Remove-Folder 
Remove-HardDisk 
Remove-Inventory 
Remove-IScsiHbaTarget
Remove-NetworkAdapter 
Remove-OSCustomizationNicMap...
Remove-OSCustomizationSpec 
Remove-PassthroughDevice 
Remove-ResourcePool
Remove-Snapshot 
Remove-StatInterval 
Remove-Template 
Remove-UsbDevice
Remove-VApp 
Remove-VICredentialStoreItem 
Remove-VIPermission
Remove-VIRole 
Remove-VirtualPortGroup 
Remove-VirtualSwitch 
Remove-VM
Remove-VMGuestRoute 
Remove-VMHost 
Remove-VMHostAccount
Remove-VMHostNetworkAdapter Remove-VMHostNtpServer Remove-VMHostProfile
Restart-VM Restart-VMGuest Restart-VMHost Restart-VMHostService
Set-Annotation Set-CDDrive Set-Cluster Set-CustomAttribute
Set-CustomField Set-Datacenter Set-Datastore Set-DrsRule Set-FloppyDrive
Set-Folder Set-HardDisk Set-IScsiHbaTarget Set-NetworkAdapter
Set-NicTeamingPolicy Set-OSCustomizationNicMapping
Set-OSCustomizationSpec Set-PowerCLIConfiguration Set-ResourcePool
Set-ScsiLun Set-ScsiLunPath Set-Snapshot Set-StatInterval Set-Template
Set-VApp Set-VIPermission Set-VIRole Set-VirtualPortGroup
Set-VirtualSwitch Set-VM Set-VMGuestNetworkInterface Set-VMGuestRoute
Set-VMHost Set-VMHostAccount Set-VMHostAdvancedConfiguration
Set-VMHostDiagnosticPartition Set-VMHostFirewallDefaultPolicy
Set-VMHostFirewallException Set-VMHostFirmware Set-VMHostHba
Set-VMHostModule Set-VMHostNetwork Set-VMHostNetworkAdapter
Set-VMHostProfile Set-VMHostService Set-VMHostSnmp Set-VMHostStartPolicy
Set-VMHostStorage Set-VMHostSysLogServer Set-VMQuestion
Set-VMResourceConfiguration Set-VMStartPolicy Shutdown-VMGuest
Start-VApp Start-VM Start-VMHost Start-VMHostService Stop-Task Stop-VApp
Stop-VM Stop-VMHost Stop-VMHostService Suspend-VM Suspend-VMGuest
Suspend-VMHost Test-VMHostProfileCompliance Test-VMHostSnmp Update-Tools
Wait-Task Attach-Baseline Detach-Baseline Download-Patch Get-Baseline
Get-Compliance Get-Patch Get-PatchBaseline New-PatchBaseline
Remediate-Inventory Remove-Baseline Scan-Inventory Set-PatchBaseline
Stage-Patch
Answer-VMQuestion 
Get-ESX
Get-PowerCLIDocumentation 
Get-VC Get-VIServer 
Get-VIToolkitConfiguration
Get-VIToolkitVersion 
Set-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.

<NotepadPlus>;  
&lt;AutoComplete&gt;  
&lt;KeyWord name="Add-PassthroughDevice"/&gt;  
&lt;KeyWord name="Add-VMHost"/&gt;  
&lt;KeyWord name="Add-VmHostNtpServer"/&gt;  
&lt;KeyWord name="Answer-VMQuestion"/&gt;  
&lt;KeyWord name="Apply-DrsRecommendation"/&gt;  
&lt;KeyWord name="Apply-VMHostProfile"/&gt;  
&lt;KeyWord name="Attach-Baseline"/&gt;  
&lt;KeyWord name="Connect-VIServer"/&gt;  
&lt;KeyWord name="Copy-DatastoreItem"/&gt;  
&lt;KeyWord name="Copy-HardDisk"/&gt;  
&lt;KeyWord name="Copy-VMGuestFile"/&gt;  
&lt;KeyWord name="Detach-Baseline"/&gt;  
&lt;KeyWord name="Disconnect-VIServer"/&gt;  
&lt;KeyWord name="Dismount-Tools"/&gt;  
&lt;KeyWord name="Download-Patch"/&gt;  
&lt;KeyWord name="Export-VApp"/&gt;  
&lt;KeyWord name="Export-VMHostProfile"/&gt;  
&lt;KeyWord name="Get-Annotation"/&gt;  
&lt;KeyWord name="Get-Baseline"/&gt;  
&lt;KeyWord name="Get-CDDrive"/&gt;  
&lt;KeyWord name="Get-Cluster"/&gt;  
&lt;KeyWord name="Get-Compliance"/&gt;  
&lt;KeyWord name="Get-CustomAttribute"/&gt;  
&lt;KeyWord name="Get-Datacenter"/&gt;  
&lt;KeyWord name="Get-Datastore"/&gt;  
&lt;KeyWord name="Get-DrsRecommendation"/&gt;  
&lt;KeyWord name="Get-DrsRule"/&gt;  
&lt;KeyWord name="Get-ESX"/&gt;  
&lt;KeyWord name="Get-FloppyDrive"/&gt;  
&lt;KeyWord name="Get-Folder"/&gt;  
&lt;KeyWord name="Get-HardDisk"/&gt;  
&lt;KeyWord name="Get-IScsiHbaTarget"/&gt;  
&lt;KeyWord name="Get-Inventory"/&gt;  
&lt;KeyWord name="Get-Log"/&gt;  
&lt;KeyWord name="Get-LogType"/&gt;  
&lt;KeyWord name="Get-NetworkAdapter"/&gt;  
&lt;KeyWord name="Get-NicTeamingPolicy"/&gt;  
&lt;KeyWord name="Get-OSCustomizationNicMapping"/&gt;  
&lt;KeyWord name="Get-OSCustomizationSpec"/&gt;  
&lt;KeyWord name="Get-PassthroughDevice"/&gt;  
&lt;KeyWord name="Get-Patch"/&gt;  
&lt;KeyWord name="Get-PatchBaseline"/&gt;  
&lt;KeyWord name="Get-PowerCLIConfiguration"/&gt;  
&lt;KeyWord name="Get-PowerCLIDocumentation"/&gt;  
&lt;KeyWord name="Get-PowerCLIVersion"/&gt;  
&lt;KeyWord name="Get-ResourcePool"/&gt;  
&lt;KeyWord name="Get-ScsiLun"/&gt;  
&lt;KeyWord name="Get-ScsiLunPath"/&gt;  
&lt;KeyWord name="Get-Snapshot"/&gt;  
&lt;KeyWord name="Get-Stat"/&gt;  
&lt;KeyWord name="Get-StatInterval"/&gt;  
&lt;KeyWord name="Get-StatType"/&gt;  
&lt;KeyWord name="Get-Task"/&gt;  
&lt;KeyWord name="Get-Template"/&gt;  
&lt;KeyWord name="Get-UsbDevice"/&gt;  
&lt;KeyWord name="Get-VApp"/&gt;  
&lt;KeyWord name="Get-VC"/&gt;  
&lt;KeyWord name="Get-VICredentialStoreItem"/&gt;  
&lt;KeyWord name="Get-VIEvent"/&gt;  
&lt;KeyWord name="Get-VIObjectByVIView"/&gt;  
&lt;KeyWord name="Get-VIPermission"/&gt;  
&lt;KeyWord name="Get-VIPrivilege"/&gt;  
&lt;KeyWord name="Get-VIRole"/&gt;  
&lt;KeyWord name="Get-VIServer"/&gt;  
&lt;KeyWord name="Get-VIToolkitConfiguration"/&gt;  
&lt;KeyWord name="Get-VIToolkitVersion"/&gt;  
&lt;KeyWord name="Get-VM"/&gt;  
&lt;KeyWord name="Get-VMGuest"/&gt;  
&lt;KeyWord name="Get-VMGuestNetworkInterface"/&gt;  
&lt;KeyWord name="Get-VMGuestRoute"/&gt;  
&lt;KeyWord name="Get-VMHost"/&gt;  
&lt;KeyWord name="Get-VMHostAccount"/&gt;  
&lt;KeyWord name="Get-VMHostAdvancedConfiguration"/&gt;  
&lt;KeyWord name="Get-VMHostAvailableTimeZone"/&gt;  
&lt;KeyWord name="Get-VMHostDiagnosticPartition"/&gt;  
&lt;KeyWord name="Get-VMHostFirewallDefaultPolicy"/&gt;  
&lt;KeyWord name="Get-VMHostFirewallException"/&gt;  
&lt;KeyWord name="Get-VMHostFirmware"/&gt;  
&lt;KeyWord name="Get-VMHostHba"/&gt;  
&lt;KeyWord name="Get-VMHostModule"/&gt;  
&lt;KeyWord name="Get-VMHostNetwork"/&gt;  
&lt;KeyWord name="Get-VMHostNetworkAdapter"/&gt;  
&lt;KeyWord name="Get-VMHostNtpServer"/&gt;  
&lt;KeyWord name="Get-VMHostProfile"/&gt;  
&lt;KeyWord name="Get-VMHostService"/&gt;  
&lt;KeyWord name="Get-VMHostSnmp"/&gt;  
&lt;KeyWord name="Get-VMHostStartPolicy"/&gt;  
&lt;KeyWord name="Get-VMHostStorage"/&gt;  
&lt;KeyWord name="Get-VMHostSysLogServer"/&gt;  
&lt;KeyWord name="Get-VMQuestion"/&gt;  
&lt;KeyWord name="Get-VMResourceConfiguration"/&gt;  
&lt;KeyWord name="Get-VMStartPolicy"/&gt;  
&lt;KeyWord name="Get-View"/&gt;  
&lt;KeyWord name="Get-VirtualPortGroup"/&gt;  
&lt;KeyWord name="Get-VirtualSwitch"/&gt;  
&lt;KeyWord name="Import-VApp"/&gt;  
&lt;KeyWord name="Import-VMHostProfile"/&gt;  
&lt;KeyWord name="Install-VMHostPatch"/&gt;  
&lt;KeyWord name="Invoke-VMScript"/&gt;  
&lt;KeyWord name="Mount-Tools"/&gt;  
&lt;KeyWord name="Move-Cluster"/&gt;  
&lt;KeyWord name="Move-Datacenter"/&gt;  
&lt;KeyWord name="Move-Folder"/&gt;  
&lt;KeyWord name="Move-Inventory"/&gt;  
&lt;KeyWord name="Move-ResourcePool"/&gt;  
&lt;KeyWord name="Move-Template"/&gt;  
&lt;KeyWord name="Move-VM"/&gt;  
&lt;KeyWord name="Move-VMHost"/&gt;  
&lt;KeyWord name="New-CDDrive"/&gt;  
&lt;KeyWord name="New-Cluster"/&gt;  
&lt;KeyWord name="New-CustomAttribute"/&gt;  
&lt;KeyWord name="New-CustomField"/&gt;  
&lt;KeyWord name="New-Datacenter"/&gt;  
&lt;KeyWord name="New-Datastore"/&gt;  
&lt;KeyWord name="New-DrsRule"/&gt;  
&lt;KeyWord name="New-FloppyDrive"/&gt;  
&lt;KeyWord name="New-Folder"/&gt;  
&lt;KeyWord name="New-HardDisk"/&gt;  
&lt;KeyWord name="New-IScsiHbaTarget"/&gt;  
&lt;KeyWord name="New-NetworkAdapter"/&gt;  
&lt;KeyWord name="New-OSCustomizationNicMapping"/&gt;  
&lt;KeyWord name="New-OSCustomizationSpec"/&gt;  
&lt;KeyWord name="New-PatchBaseline"/&gt;  
&lt;KeyWord name="New-ResourcePool"/&gt;  
&lt;KeyWord name="New-Snapshot"/&gt;  
&lt;KeyWord name="New-StatInterval"/&gt;  
&lt;KeyWord name="New-Template"/&gt;  
&lt;KeyWord name="New-VApp"/&gt;  
&lt;KeyWord name="New-VICredentialStoreItem"/&gt;  
&lt;KeyWord name="New-VIPermission"/&gt;  
&lt;KeyWord name="New-VIRole"/&gt;  
&lt;KeyWord name="New-VM"/&gt;  
&lt;KeyWord name="New-VMGuestRoute"/&gt;  
&lt;KeyWord name="New-VMHostAccount"/&gt;  
&lt;KeyWord name="New-VMHostNetworkAdapter"/&gt;  
&lt;KeyWord name="New-VMHostProfile"/&gt;  
&lt;KeyWord name="New-VirtualPortGroup"/&gt;  
&lt;KeyWord name="New-VirtualSwitch"/&gt;  
&lt;KeyWord name="Remediate-Inventory"/&gt;  
&lt;KeyWord name="Remove-Baseline"/&gt;  
&lt;KeyWord name="Remove-CDDrive"/&gt;  
&lt;KeyWord name="Remove-Cluster"/&gt;  
&lt;KeyWord name="Remove-CustomAttribute"/&gt;  
&lt;KeyWord name="Remove-CustomField"/&gt;  
&lt;KeyWord name="Remove-Datacenter"/&gt;  
&lt;KeyWord name="Remove-Datastore"/&gt;  
&lt;KeyWord name="Remove-DrsRule"/&gt;  
&lt;KeyWord name="Remove-FloppyDrive"/&gt;  
&lt;KeyWord name="Remove-Folder"/&gt;  
&lt;KeyWord name="Remove-HardDisk"/&gt;  
&lt;KeyWord name="Remove-IScsiHbaTarget"/&gt;  
&lt;KeyWord name="Remove-Inventory"/&gt;  
&lt;KeyWord name="Remove-NetworkAdapter"/&gt;  
&lt;KeyWord name="Remove-OSCustomizationNicMap..."/&gt;  
&lt;KeyWord name="Remove-OSCustomizationSpec"/&gt;  
&lt;KeyWord name="Remove-PassthroughDevice"/&gt;  
&lt;KeyWord name="Remove-ResourcePool"/&gt;  
&lt;KeyWord name="Remove-Snapshot"/&gt;  
&lt;KeyWord name="Remove-StatInterval"/&gt;  
&lt;KeyWord name="Remove-Template"/&gt;  
&lt;KeyWord name="Remove-UsbDevice"/&gt;  
&lt;KeyWord name="Remove-VApp"/&gt;  
&lt;KeyWord name="Remove-VICredentialStoreItem"/&gt;  
&lt;KeyWord name="Remove-VIPermission"/&gt;  
&lt;KeyWord name="Remove-VIRole"/&gt;  
&lt;KeyWord name="Remove-VM"/&gt;  
&lt;KeyWord name="Remove-VMGuestRoute"/&gt;  
&lt;KeyWord name="Remove-VMHost"/&gt;  
&lt;KeyWord name="Remove-VMHostAccount"/&gt;  
&lt;KeyWord name="Remove-VMHostNetworkAdapter"/&gt;  
&lt;KeyWord name="Remove-VMHostNtpServer"/&gt;  
&lt;KeyWord name="Remove-VMHostProfile"/&gt;  
&lt;KeyWord name="Remove-VirtualPortGroup"/&gt;  
&lt;KeyWord name="Remove-VirtualSwitch"/&gt;  
&lt;KeyWord name="Restart-VM"/&gt;  
&lt;KeyWord name="Restart-VMGuest"/&gt;  
&lt;KeyWord name="Restart-VMHost"/&gt;  
&lt;KeyWord name="Restart-VMHostService"/&gt;  
&lt;KeyWord name="Scan-Inventory"/&gt;  
&lt;KeyWord name="Set-Annotation"/&gt;  
&lt;KeyWord name="Set-CDDrive"/&gt;  
&lt;KeyWord name="Set-Cluster"/&gt;  
&lt;KeyWord name="Set-CustomAttribute"/&gt;  
&lt;KeyWord name="Set-CustomField"/&gt;  
&lt;KeyWord name="Set-Datacenter"/&gt;  
&lt;KeyWord name="Set-Datastore"/&gt;  
&lt;KeyWord name="Set-DrsRule"/&gt;  
&lt;KeyWord name="Set-FloppyDrive"/&gt;  
&lt;KeyWord name="Set-Folder"/&gt;  
&lt;KeyWord name="Set-HardDisk"/&gt;  
&lt;KeyWord name="Set-IScsiHbaTarget"/&gt;  
&lt;KeyWord name="Set-NetworkAdapter"/&gt;  
&lt;KeyWord name="Set-NicTeamingPolicy"/&gt;  
&lt;KeyWord name="Set-OSCustomizationNicMapping"/&gt;  
&lt;KeyWord name="Set-OSCustomizationSpec"/&gt;  
&lt;KeyWord name="Set-PatchBaseline"/&gt;  
&lt;KeyWord name="Set-PowerCLIConfiguration"/&gt;  
&lt;KeyWord name="Set-ResourcePool"/&gt;  
&lt;KeyWord name="Set-ScsiLun"/&gt;  
&lt;KeyWord name="Set-ScsiLunPath"/&gt;  
&lt;KeyWord name="Set-Snapshot"/&gt;  
&lt;KeyWord name="Set-StatInterval"/&gt;  
&lt;KeyWord name="Set-Template"/&gt;  
&lt;KeyWord name="Set-VApp"/&gt;  
&lt;KeyWord name="Set-VIPermission"/&gt;  
&lt;KeyWord name="Set-VIRole"/&gt;  
&lt;KeyWord name="Set-VM"/&gt;  
&lt;KeyWord name="Set-VMGuestNetworkInterface"/&gt;  
&lt;KeyWord name="Set-VMGuestRoute"/&gt;  
&lt;KeyWord name="Set-VMHost"/&gt;  
&lt;KeyWord name="Set-VMHostAccount"/&gt;  
&lt;KeyWord name="Set-VMHostAdvancedConfiguration"/&gt;  
&lt;KeyWord name="Set-VMHostDiagnosticPartition"/&gt;  
&lt;KeyWord name="Set-VMHostFirewallDefaultPolicy"/&gt;  
&lt;KeyWord name="Set-VMHostFirewallException"/&gt;  
&lt;KeyWord name="Set-VMHostFirmware"/&gt;  
&lt;KeyWord name="Set-VMHostHba"/&gt;  
&lt;KeyWord name="Set-VMHostModule"/&gt;  
&lt;KeyWord name="Set-VMHostNetwork"/&gt;  
&lt;KeyWord name="Set-VMHostNetworkAdapter"/&gt;  
&lt;KeyWord name="Set-VMHostProfile"/&gt;  
&lt;KeyWord name="Set-VMHostService"/&gt;  
&lt;KeyWord name="Set-VMHostSnmp"/&gt;  
&lt;KeyWord name="Set-VMHostStartPolicy"/&gt;  
&lt;KeyWord name="Set-VMHostStorage"/&gt;  
&lt;KeyWord name="Set-VMHostSysLogServer"/&gt;  
&lt;KeyWord name="Set-VMQuestion"/&gt;  
&lt;KeyWord name="Set-VMResourceConfiguration"/&gt;  
&lt;KeyWord name="Set-VMStartPolicy"/&gt;  
&lt;KeyWord name="Set-VirtualPortGroup"/&gt;  
&lt;KeyWord name="Set-VirtualSwitch"/&gt;  
&lt;KeyWord name="Shutdown-VMGuest"/&gt;  
&lt;KeyWord name="Stage-Patch"/&gt;  
&lt;KeyWord name="Start-VApp"/&gt;  
&lt;KeyWord name="Start-VM"/&gt;  
&lt;KeyWord name="Start-VMHost"/&gt;  
&lt;KeyWord name="Start-VMHostService"/&gt;  
&lt;KeyWord name="Stop-Task"/&gt;  
&lt;KeyWord name="Stop-VApp"/&gt;  
&lt;KeyWord name="Stop-VM"/&gt;  
&lt;KeyWord name="Stop-VMHost"/&gt;  
&lt;KeyWord name="Stop-VMHostService"/&gt;  
&lt;KeyWord name="Suspend-VM"/&gt;  
&lt;KeyWord name="Suspend-VMGuest"/&gt;  
&lt;KeyWord name="Suspend-VMHost"/&gt;  
&lt;KeyWord name="Test-VMHostProfileCompliance"/&gt;  
&lt;KeyWord name="Test-VMHostSnmp"/&gt;  
&lt;KeyWord name="Update-Tools"/&gt;  
&lt;KeyWord name="Wait-Task "/&gt;  

Share this post:

Social