Faster coding with Visual Studio Code and PowerShell

Faster coding with Visual Studio Code and PowerShell

I’m not a developer in any way, but I want to share something I discovered while learning R programing language and to my pleasant surprise it works with PowerShell as well. If you are programmer maybe it is no surprise to you, that you can speed up your taping using Tab key on your keyboard. Just tap first few letter of the command, parameter you want to use press Tab key and magic your command is completed for you without a need to tap all command. But there is more, I have installed Visual Studio Code as this is a good platform to work with many different languages without switching to a different text editor.

As I mention, I was trying to learn R language and using Visual Studio Code following the Pluralsight course. And magic happens, I was taping command println and I notice something if you press the first letter of the parameter on my keyboard VS Code display possible commands which start with p, you can use the tab key to select which command you want to use if the command is second on the list you press 2 times tab key and … you command is there. But there is more …

I’m using PowerShell for this example because it is my preferred language (especially when I work). Everyone knows that PowerShell commands are quite long sometimes for example:

Get-AzureBatchJobPreparationAndReleaseTaskStatus

That’s a lot taping even when using the Tab key as this command is 5th on the list which
you will get after taping Get-Az…
Get-Azure command

Get-AzureBatchJobPreparationAndReleaseTaskStatus command

Here comes the sweet part of using VS Code editor with PowerShell. Get-AzureBatchJobPreparationAndReleaseTaskStatus you can see that this command is composed of words Azure Batch Job Preparation And Release Task Status now if I tap in VS Code Get-Azbjp only command which I looking for will stay, simple tab key press and command ready to use. This method works as well with parameters.

Get-Azure complation

Entering command using the first letter of words

 

Powershell VSCode

Entering command using the first letter of words

I know what I will be using now for writing my scripts.

Hope you will find this useful and thanks for reading.

Advertisements