mirror of
https://github.com/NexusOne23/noid-privacy.git
synced 2026-04-05 15:27:21 +02:00
Some checks failed
CI - PowerShell Quality Checks / PSScriptAnalyzer (push) Has been cancelled
CI - PowerShell Quality Checks / Test on PowerShell 5.1 (push) Has been cancelled
CI - PowerShell Quality Checks / Test on PowerShell 7.4 (push) Has been cancelled
CI - PowerShell Quality Checks / Validate Project Structure (push) Has been cancelled
Pester Tests / test (push) Has been cancelled
Version bump across 62 files (2.2.3 → 2.2.4). CHANGELOG.md: New [2.2.4] section with EDR/XDR detection and version tooling. README.md: Updated release highlights, AV detection example output synced with code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
92 lines
2.2 KiB
PowerShell
92 lines
2.2 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Compatibility wrappers for module function calls
|
|
|
|
.DESCRIPTION
|
|
Provides wrapper functions to ensure compatibility between module calls
|
|
and core framework functions. Maps old function names to new names.
|
|
|
|
.NOTES
|
|
Author: NexusOne23
|
|
Version: 2.2.4
|
|
Requires: PowerShell 5.1+
|
|
#>
|
|
|
|
function Test-IsAdmin {
|
|
<#
|
|
.SYNOPSIS
|
|
Wrapper for Test-IsAdministrator
|
|
|
|
.DESCRIPTION
|
|
Checks if the current PowerShell session has administrator privileges
|
|
|
|
.OUTPUTS
|
|
Boolean indicating administrator status
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([bool])]
|
|
param()
|
|
|
|
return Test-IsAdministrator
|
|
}
|
|
|
|
function Test-WindowsVersion {
|
|
<#
|
|
.SYNOPSIS
|
|
Wrapper for Get-WindowsVersion with minimum build check
|
|
|
|
.DESCRIPTION
|
|
Checks if Windows version meets minimum requirements
|
|
|
|
.PARAMETER MinimumBuild
|
|
Minimum required build number (default: 22000 for Windows 11)
|
|
|
|
.OUTPUTS
|
|
Boolean indicating if version requirement is met
|
|
#>
|
|
[CmdletBinding()]
|
|
[OutputType([bool])]
|
|
param(
|
|
[Parameter(Mandatory = $false)]
|
|
[int]$MinimumBuild = 22000
|
|
)
|
|
|
|
$versionInfo = Get-WindowsVersion
|
|
return ($versionInfo.BuildNumber -ge $MinimumBuild)
|
|
}
|
|
|
|
function New-RegistryBackup {
|
|
<#
|
|
.SYNOPSIS
|
|
Wrapper for Backup-RegistryKey
|
|
|
|
.DESCRIPTION
|
|
Creates a backup of a registry key before modification
|
|
|
|
.PARAMETER Path
|
|
Registry path to backup
|
|
|
|
.PARAMETER BackupId
|
|
Optional backup identifier
|
|
|
|
.OUTPUTS
|
|
PSCustomObject with backup results
|
|
#>
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Path,
|
|
|
|
[Parameter(Mandatory = $false)]
|
|
[string]$BackupId
|
|
)
|
|
|
|
# Ensure a valid backup name is always passed to Backup-RegistryKey
|
|
if (-not $BackupId) {
|
|
$BackupId = "RegistryBackup_{0:yyyyMMdd_HHmmss}" -f (Get-Date)
|
|
}
|
|
|
|
return Backup-RegistryKey -KeyPath $Path -BackupName $BackupId
|
|
}
|
|
|
|
# Note: Export-ModuleMember not used - this script is dot-sourced, not imported as module
|