File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Function get-VTFileReport
10
10
param ([Parameter (Mandatory = $true )] [array ]$h )
11
11
12
12
# # Get your own VT API key here: https://www.virustotal.com/gui/join-us
13
- $VTApiKey = " xxxxxxxxxxxxxxxxxxxxxxxxxxxx "
13
+ $VTApiKey = " xxxxxxxxxxxxxx "
14
14
15
15
# # Set TLS 1.2
16
16
[Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
@@ -30,6 +30,14 @@ Function get-VTFileReport
30
30
$VTbody = @ {resource = $hash ; apikey = $VTApiKey }
31
31
$VTresult = Invoke-RestMethod - Method GET - Uri ' https://www.virustotal.com/vtapi/v2/file/report' - Body $VTbody
32
32
33
+ # # Calculate percentage if there is a result
34
+ if ($VTresult.positives -ge 1 ) {
35
+ $VTpct = (($VTresult.positives ) / ($VTresult.total )) * 100
36
+ $VTpct = [math ]::Round($VTpct , 2 )
37
+ }
38
+ else {
39
+ $VTpct = 0
40
+ }
33
41
# # Custom Object for data output
34
42
[PSCustomObject ]@ {
35
43
resource = $VTresult.resource
You can’t perform that action at this time.
0 commit comments