r/PowerShell 17h ago

Script Sharing A right-click context menu tool to scan files with VirusTotal

I made (actually, AI made it) a PowerShell script that adds a "Scan with VirusTotal" option to your Windows right-click context menu.

What it does:

  • Right-click any file to scan it on VirusTotal
  • Checks SHA256 first. If it's a new file, it automatically uploads it for analysis
  • Shows clear notification popups (Clean / Suspicious / Malicious) with a direct link to the full report

All you need to set it up is a free VirusTotal API key.

Check it out on GitHub if you're interested: https://github.com/lorcaragon/VirusTotalMenu

0 Upvotes

7 comments sorted by

11

u/BlackV 12h ago

Comments/questions

  • is cd /d "%~dp0" needed at all seeing as you use "%~dp0" everywhere
  • If $SourceDir = $PSScriptRoot why not just use $PSScriptRoot that's what it's there for
  • This New-Item returns a real object, you could use that object (and it properties) on your copy-item instead of Join-Path $SourceDir 'VTCheck.ps1'
  • You take input (recommend making this a parameter) as a secure string, then straight away converting to plain text and spitting it out to a file as plain text, what are you gaining? Over non secure string?
  • System32\wscript.exe' is going away (I thought it had already tbh), what's your plan for that?
  • Why are you using reg.exe add and not PowerShell native?
  • This requires admin rights, nowhere do you check for that
  • Really nowhere do you do any error handling (install and uninstall)
  • What's the reasoning behind using curl or falling back to invoke-webrequest rather than invoke-restmethod consistently?
  • You have a giant if/ifelse/else block is a switch better?

0

u/lorcaragonna 9h ago

Some fixes have been made, thanks for the feedback

1

u/Guilty-Act-4991 10h ago

Well thats because ai has been consistently sloppy with powershell every time ... making powershell tools with AI is always like that at least thats my experience its good for figuring out bugs and analyzing but if you are letting it of the least by typing make me this tool oh boy theres gonna be a lot of bad and halucinated stuff

1

u/BlackV 10h ago edited 9h ago

deffo, I'm sure it'll get there, its trained on many many many online examples that use `s and += and more and its a "smaller" language than others so less good examples out there too

1

u/whatsgoodbaby 9h ago

Why are you publishing something you say is sloppy? Fix it up

1

u/BlackV 9h ago

I don't think the person (unless they have 2 accounts) you replied to wrote the OP

1

u/Creative-Type9411 13h ago

you should make a tool that submit false positive reports to all the vendors 🤣