Secure File Association Management for Windows
Version 1.0.0 | MIT License |
GitHub Repository
FtypeAudit is a PowerShell-based toolkit for:
# Download and run directly
irm https://ftypeaudit.example.com/latest.ps1 | iex
# Install from PowerShell Gallery
Install-Module -Name FtypeAudit -Scope CurrentUser
# Manual module placement
Copy-Item -Path .\FtypeAudit -Destination $env:PSModulePath -Recurse
Requirements:
RemoteSigned
Feature | Description | Safety Level |
---|---|---|
Elevation Guard |
Warns when running unprivileged | β οΈ Advisory |
Dry-Run Mode |
Preview changes without execution | π‘οΈ Protected |
Registry Backup |
Automatic .REG file snapshots | π Reversible |
Signature Validation |
Verify script integrity via PGP | π Trusted |
MRU Forensics |
Detect historical handler drift | π Investigative |
# Single extension analysis
Get-FileAssociation -Extension .pdf -Verbose
# Full system scan
Invoke-FullAssociationAudit -OutputFormat JSON
# Safe removal of invalid entries
Clear-AssociationArtifacts -Extension .docx -BackupPath ~/backups
# Force repair with confirmation
Repair-FileHandlers -Extension .ps1 -Force -Confirm:$false
# Export settings for compliance
Export-AssociationPolicy -Path .\policy.json
# Import organizational standards
Import-AssociationPolicy -Path .\enterprise_rules.json
Command | Parameters | Output |
---|---|---|
Get-FileAssociation |
-Extension , -Depth |
Object |
Clear-AssociationArtifacts |
-Backup , -Force |
Log |
Compare-AssociationProfiles |
-Source , -Target |
Diff |
Flag | Purpose |
---|---|
-WhatIf |
Simulation mode |
-Historical |
Show 30-day changes |
-DigitalSignature |
Verify code signature |
New-RegistryCheckpoint -Name "PreAudit"
Get-AuthenticodeSignature .\FtypeAudit.ps1 | Verify-Signature
Invoke-UserScopeAnalysis -CurrentUser
# Bulk handler repair
Get-ChildItem *.log | ForEach-Object {
Get-FileAssociation $_.Extension |
Repair-FileHandlers -Policy Strict
}
# Scheduled audit task
Register-ScheduledJob -Name "DailyFtypeCheck" -ScriptBlock {
Import-Module FtypeAudit
Invoke-FullAssociationAudit |
Export-Clixml "\\server\audits\$(Get-Date -Format yyyyMMdd).xml"
} -Trigger (New-JobTrigger -Daily -At 2AM)
# Compare user vs system defaults
$user = Get-FileAssociation .pdf -Scope CurrentUser
$system = Get-FileAssociation .pdf -Scope AllUsers
Compare-AssociationProfiles -Reference $user -Difference $system
Symptom | Solution |
---|---|
Access Denied | Run as Admin β Start-Process powershell -Verb RunAs |
Missing Handlers | Restore-DefaultHandlers -Extension .xlsx |
Ghost Entries | Clear-AssociationArtifacts -Force -Backup |
# Registry health check
Test-AssociationStore -Scope AllUsers
# Handler resolution test
Resolve-FileHandler -Path example.rtf -Simulate
Q: How to handle UWP app associations?
A: Use Get-AppxHandlers
for modern apps:
Get-AppxHandlers -Package *Microsoft.Paint*
Q: Why canβt I modify certain associations?
A: Some system-protected types require Group Policy overrides.
Q: Cross-user association management?
A: Use -Scope
parameter:
Get-FileAssociation .mp3 -Scope AllUsers
MIT License
Copyright (c) 2024 William Stetar
Permission is hereby granted... (standard MIT terms)
For full license text, see LICENSE.md
Need Help?
Open an Issue |