noid-privacy/Modules/ASR/ASR.psm1
NexusOne23 da9f937ee8 release: v2.2.3 - Fix Restore Mode module selection crash
CHANGELOG:
- Fixed: Restore Mode manual module selection crash (Critical)
- Root cause: .Split(',', ';', ' ') triggered wrong .NET overload
- Fix: Replaced with native PowerShell -split '[,; ]' operator
- Reported by: KatCat2

VERSION BUMP: 2.2.2 -> 2.2.3
- Updated 48 files with new version number
- CHANGELOG.md: Added v2.2.3 release notes
- README.md: Updated badge, module table, project status
2026-01-07 18:46:14 +01:00

52 lines
1.5 KiB
PowerShell

<#
.SYNOPSIS
Attack Surface Reduction (ASR) Module
.DESCRIPTION
Enables all 19 Microsoft Defender ASR rules in Block mode for comprehensive protection.
Hybrid implementation:
- Registry for backup/verification
- Set-MpPreference for clean application
.NOTES
Author: NexusOne23
Version: 2.2.3
Requires: PowerShell 5.1+, Administrator privileges, Windows Defender
#>
# Get the module root path
$ModuleRoot = $PSScriptRoot
# Dot source all Private functions
$PrivatePath = Join-Path $ModuleRoot "Private"
if (Test-Path $PrivatePath) {
Get-ChildItem -Path $PrivatePath -Filter "*.ps1" | ForEach-Object {
try {
. $_.FullName
}
catch {
Write-Host "WARNING: Failed to import private function $($_.Name): $_" -ForegroundColor Yellow
}
}
}
# Dot source all Public functions
$PublicPath = Join-Path $ModuleRoot "Public"
if (Test-Path $PublicPath) {
Get-ChildItem -Path $PublicPath -Filter "*.ps1" | ForEach-Object {
try {
. $_.FullName
}
catch {
Write-Host "WARNING: Failed to import public function $($_.Name): $_" -ForegroundColor Yellow
}
}
}
# Export public functions + Test-ASRCompliance (needed for Invoke-ASRRules verification)
Export-ModuleMember -Function @('Invoke-ASRRules', 'Test-ASRCompliance')
# Alias for naming consistency (non-breaking change)
New-Alias -Name 'Invoke-ASR' -Value 'Invoke-ASRRules' -Force
Export-ModuleMember -Alias 'Invoke-ASR'