1 # Config
2 $urlPath = "https://nmap.org/npcap/dist/npcap-0.90.exe"
3 $checksum = "0477a42a9c54f31a7799fb3ee0537826041730f462abfc066fe36d81c50721a7"
4 
5 ############
6 ############
7 # Download the file
8 wget $urlPath -UseBasicParsing -OutFile $PSScriptRoot"\npcap.exe"
9 # Now let's check its checksum
10 $_chksum = $(CertUtil -hashfile $PSScriptRoot"\npcap.exe" SHA256)[1] -replace " ",""
11 if ($_chksum -ne $checksum){
12     echo "Checksums does NOT match !"
13     exit
14 } else {
15     echo "Checksums matches !"
16 }
17 # Run installer
18 Start-Process $PSScriptRoot"\npcap.exe" -ArgumentList "/loopback_support=yes /S" -wait
19 echo "Npcap installation completed"