-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminSDHolder.psm1
More file actions
29 lines (25 loc) · 963 Bytes
/
AdminSDHolder.psm1
File metadata and controls
29 lines (25 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# AdminSDHolder.psm1
# Optional PowerShell module — dot-sources all Public scripts and exports their functions.
#
# Usage:
# Import-Module .\AdminSDHolder.psm1
# Get-AdminSDHolderACL
# Invoke-AdminSDHolderCleanup
# Repair-AdminSDHolderACL -Remediate
# Add-AdminSDHolderBackdoor -Account "svc_backup" -Remove
$PrivatePath = Join-Path $PSScriptRoot 'Private'
$PublicPath = Join-Path $PSScriptRoot 'Public'
# Load shared constants and helpers first
foreach ($File in @('Constants.ps1', 'Helpers.ps1')) {
$FullPath = Join-Path $PrivatePath $File
if (Test-Path $FullPath) { . $FullPath }
}
# Dot-source all Public scripts (defines functions, does not execute them)
Get-ChildItem -Path $PublicPath -Filter '*.ps1' -ErrorAction SilentlyContinue |
ForEach-Object { . $_.FullName }
Export-ModuleMember -Function @(
'Get-AdminSDHolderACL',
'Invoke-AdminSDHolderCleanup',
'Repair-AdminSDHolderACL',
'Add-AdminSDHolderBackdoor'
)