Updated the manuals

This commit is contained in:
Markus Fleschutz
2025-01-17 08:31:53 +01:00
parent efe4a2c6b4
commit 33ef92d879
635 changed files with 2375 additions and 1666 deletions

View File

@ -1,12 +1,12 @@
The *scan-folder.ps1* Script
===========================
This PowerShell script scans a directory tree for malware. Requires the installation of ESET or Windows Defender.
This PowerShell script scans a folder for malware (including subfolders). Requires ESET Endpoint Security or Windows Defender.
Parameters
----------
```powershell
/home/markus/Repos/PowerShell/scripts/scan-folder.ps1 [[-path] <String>] [<CommonParameters>]
/Repos/PowerShell/scripts/scan-folder.ps1 [[-path] <String>] [<CommonParameters>]
-path <String>
Specifies the file path to the folder (default is working directory).
@ -26,7 +26,7 @@ Example
-------
```powershell
PS> ./scan-folder.ps1 C:\Windows
Scanning 📂C:\Windows with ESET Antivirus...
Scanning C:\Windows with ESET Endpoint Security...
...
```
@ -44,14 +44,14 @@ Script Content
```powershell
<#
.SYNOPSIS
Scans a directory tree for malware
Scans a folder for malware
.DESCRIPTION
This PowerShell script scans a directory tree for malware. Requires the installation of ESET or Windows Defender.
This PowerShell script scans a folder for malware (including subfolders). Requires ESET Endpoint Security or Windows Defender.
.PARAMETER path
Specifies the file path to the folder (default is working directory).
.EXAMPLE
PS> ./scan-folder.ps1 C:\Windows
⏳ Scanning 📂C:\Windows with ESET Antivirus...
⏳ Scanning C:\Windows with ESET Endpoint Security...
...
.LINK
https://github.com/fleschutz/PowerShell
@ -68,22 +68,20 @@ try {
$path = Resolve-Path $path
if (Test-Path "C:\Program Files\ESET\ESET Security\ecls.exe" -pathType leaf) {
"⏳ Scanning 📂$path with ESET Antivirus..."
Write-Host "⏳ Scanning $path with ESET Endpoint Security..."
& "C:\Program Files\ESET\ESET Security\ecls.exe" $path
if ($lastExitCode -ne 0) { throw "ESET Antivirus failed with exit code $lastExitCode - POTENTIAL DANGER!!!" }
if ($lastExitCode -ne 0) { throw "ESET Endpoibnt Security exited with code $lastExitCode - POTENTIAL THREAT !!!" }
} elseif (Test-Path "C:\Program Files\Windows Defender\MpCmdRun.exe" -pathType leaf) {
"⏳ Scanning 📂$path with Windows Defender..."
Write-Host "⏳ Scanning $path with Windows Defender..."
& "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 2 -File $path
if ($lastExitCode -ne 0) { throw "Windows Defender failed with exit code $lastExitCode - POTENTIAL DANGER !!!" }
if ($lastExitCode -ne 0) { throw "Windows Defender exited with code $lastExitCode - POTENTIAL THREAT !!!" }
} else {
throw "Found no ESET or Windows Defender - please install one."
throw "No ESET Endpoint Security or Windows Defender available - please install one."
}
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✅ Scanned 📂$path in $($elapsed)s: No malware found."
Write-Host "✅ Scanned $path in $($elapsed)s: No malware found."
exit 0 # success
} catch {
"⚠️ Error: $($Error[0])"
@ -91,4 +89,4 @@ try {
}
```
*(generated by convert-ps2md.ps1 as of 11/20/2024 11:52:00)*
*(page generated by convert-ps2md.ps1 as of 01/17/2025 08:30:57)*