Advertisement
easternnl

VirusScanner Test

Nov 23rd, 2015
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Import-Module C:\Users\erik\Documents\WASP\WASP.dll
  2.  
  3. $eicar = "$env:TEMP\eicar.txt"
  4. $download = Invoke-WebRequest https://secure.eicar.org/eicar.com.txt -OutFile $eicar
  5.  
  6. # try to open the downloaded virus
  7. $ErrorActionPreference = "Stop"
  8.  
  9. try
  10. {
  11.     $virus = gc $eicar
  12.  
  13.     write-host -ForegroundColor Red "Virus scanner NOT active"
  14. }
  15. catch
  16. {
  17.     write-host -ForegroundColor Green "Virus scanner active"
  18.     Select-Window -Title "Virus*" | Set-WindowActive
  19.  
  20.     sleep 2
  21.  
  22.     Select-Window -Title "Virus*" | Set-WindowActive | Remove-Window
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement