Useful Windows Defender exclusions to speed up development environment

If you work as a developer with tools such as Angular, Java, Node, Git etc. here are some useful exclusions to add to Windows Defender. It will speed your development computer up.
(In windows 10: search for “defender” -> “Virus & threat protection …” -> “Exclusions” -> Add or remove exclusions).

Node.js:
Process:
node.exe

Folders:
%userprofile%\AppData\Roaming\npm
%userprofile%\AppData\Roaming\npm-cache

Your projects/repos folder:
C:\Repos

IDEs:
File: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
Folder: C:\Program Files\JetBrains\WebStorm 2018.3.4

Various tools/processes:
Process: java.exe
Process: git.exe
Process: SourceTree.exe

There might be improvements depending on which type of exclusions that is most efficient. E.g. folder exclusion instead of a single exe file etc.

Warning! This means the above processes, folders and files are no longer under protection. Use at own risk. 

Adding exclusions using powershell:
Start powershell as administrator.
Enter this:

Add-MpPreference -ExclusionProcess node.exe
Add-MpPreference -ExclusionProcess git.exe
Add-MpPreference -ExclusionProcess SourceTree.exe
Add-MpPreference -ExclusionProcess SourceTree.exe
Add-MpPreference -ExclusionProcess devenv.exe
Add-MpPreference -ExclusionProcess Code.exe
Add-MpPreference -ExclusionPath C:\Repos
Add-MpPreference -ExclusionPath %userprofile%\AppData\Roaming\npm
Add-MpPreference -ExclusionPath %userprofile%\AppData\Roaming\npm-cache
Add-MpPreference -ExclusionPath "C:\Program Files (x86)\Microsoft Visual Studio\2019"
Add-MpPreference -ExclusionPath "C:\Program Files\JetBrains\WebStorm 2019.3.3"

More info regarding exclusions:

You can exclude certain files, folders, processes, and process-opened files from Windows Defender Antivirus scans. Such exclusions apply to scheduled scanson-demand scans, and always-on real-time protection and monitoring. Exclusions for process-opened files only apply to real-time protection.

When you add a process to the process exclusion list, Windows Defender Antivirus won’t scan files opened by that process, no matter where the files are located. The process itself, however, will be scanned unless it has also been added to the file exclusion list.

The process exclusions only apply to always-on real-time protection and monitoring. They don’t apply to scheduled or on-demand scans.

From: https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-antivirus/configure-exclusions-windows-defender-antivirus

 

 

Setup Virtual Machine for testing browser Microsoft Edge version 18

I needed to test a locally developed website in old legacy browser Microsoft Edge version 18. My system is Windows 10 using Oracle VM VirtualBox software.

Here is how to setup the Virtual Machine for accessing an Angular website on the “localhost” hostname. The website also makes requests to a localhost Java based REST API. E.g. upon entering http://localhost:4200 in the VM it should work the same as in the host OS.

Download Edge Virtual Machine

VirtualBox software: Oracle VM VirtualBox software
Edge Image: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
Use the “Virtualbox” VM image.
Direct link:
https://az792536.vo.msecnd.net/vms/VMBuild_20190311/VirtualBox/MSEdge/MSEdge.Win10.VirtualBox.zip
The VM password is: Passw0rd!

Make Angular development server available as “localhost” in the VM

Setup network:
In Oracle VM VirtualBox -> Settings -> network -> Attached to: “NAT”

Advanced -> port forwarding:
Name:”Angular server”, Protocol: TCP, Host port: 4200, Guest port: 4200
(dont set host and guest IP)

The above makes the Angular web development server (ng serve) available on http://localhost:4200 in the VM.

Make a Java Spring backend API available as “localhost” in the VM

(In the VM environment)
Add to the c:\windows\system32\drivers\etc\hosts file:

10.0.2.2 outer

The above config tells the VM OS to expose all requests of 10.0.2.2 to the “outer” hosting machine.

(In the VM environment)
Start an elevated cmd and enter this:

netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=8081 connectaddress=10.0.2.2 connectport=8081

The above command will forward all requests for localhost:8081 to 10.0.2.2:8081 (which the hosts file made available for the “outer” host OS).

Reconnect a network share with credentials on Windows 8 login

Such as the WD MyCloud network disk…

Create a .bat file and enter this:
net use Z: \\192.168.0.2\Document mysecretpassword /user:MyUserName /persistent:yes

Replace text in bold.

Add a shortcut to the bat file to the Startup folder:
C:\Users\[MyUserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Set the shortcut to run in “minimized window” to avoid showing the window.

Technet info for NET command:
http://technet.microsoft.com/en-us/library/bb490717.aspx