mirror of https://github.com/raandree/NTFSSecurity
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5.2 KiB
5.2 KiB
| status | last-verified | owner | source |
|---|---|---|---|
| current | 2026-10-04 | active-agent | repository evidence |
System patterns
Architecture
NTFSSecurity.psd1 ─┬─ ScriptsToProcess: NTFSSecurity.Init.ps1
│ Add-Type: Security2.dll, PrivilegeControl.dll,
│ ProcessPrivileges.dll, inline NTFS.DriveInfoExt;
│ Update-FormatData -PrependPath format.ps1xml
├─ TypesToProcess: NTFSSecurity.types.ps1xml
│ (Owner, IsInheritanceBlocked, LengthOnDisk on
│ FileInfo/DirectoryInfo; AccountType on ACEs)
├─ RootModule: NTFSSecurity.psm1 (aliases)
├─ NestedModules: NTFSSecurity.dll (36 cmdlets)
└─ en-US\NTFSSecurity.dll-Help.xml (Get-Help; generated
from Docs/Cmdlets, Decision 8)
NTFSSecurity.dll ── cmdlets ──> Security2.dll (FileSystemAccessRule2,
FileSystemAuditRule2, IdentityReference2,
FileSystemInheritanceInfo, EffectiveAccess)
── long paths ──> AlphaFS
── privileges ──> PrivilegeControl / ProcessPrivileges
BaseCmdletresolves relative paths against$PWD.BaseCmdletWithPrivControl(access, audit, inheritance, owner, security descriptor, and privilege cmdlets) enables Backup, Restore, TakeOwnership, and Security inBeginProcessingwhenPrivateData.EnablePrivilegesis$true, and disables the ones it enabled inEndProcessing.PrivateDataswitches:EnablePrivileges(base cmdlet),GetInheritedFrom(Get-NTFSAccess,Get-NTFSAudit),GetFileSystemModePropertyandIdentifyHardLinks(Get-ChildItem2),ShowAccountSid(format file).- Cmdlets accept either
-Path(aliasFullName) or-SecurityDescriptor(fromGet-NTFSSecurityDescriptor); SD sets change the in-memory object untilSet-NTFSSecurityDescriptorwrites it back.
Decisions
Each Decision record is a file in decisions/; read only the relevant ones.
Patterns
Verifying documentation
- Run platyPS in Windows PowerShell 5.1 against a module build; a copy of
Docs/Cmdletsmust round-trip throughUpdate-MarkdownHelpunchanged. platyPS rewrites non-ASCII punctuation, so keep cmdlet pages ASCII-only. It takes a parameter'sPositionfromGet-Help, that is from the shipped help file: after a position change, edit the page YAML, runNew-ExternalHelp, rebuild, and check the round trip. - Links: MarkdownLinkCheck checks relative
Docslinks (no anchors),Tests\Wiki.Tests.ps1the wiki links and anchors; neither coversREADME.mdandCHANGELOG.md. The wiki is generated fromDocs(never edit it);Docs/README.mdbecomes Home, its cmdlet groups the sidebar. - In cmdlet pages, end a sentence with a link (platyPS drops the space after
it). Verify examples in a
$env:TEMPsandbox, never on real data.
Testing the module
- Pester 5 tests in
Tests/*.Tests.ps1importNTFSSecurity\bin\Release\NTFSSecurity.psd1; CI runs every file ofTestsin Windows PowerShell 5.1 and in PowerShell 7 (Decision 11) with.github/scripts/Invoke-Tests.ps1(job summary, NUnittest-results). - A test that changes files, links, or security descriptors uses
Tests\TestHelpers.psm1: its own sandbox below$env:TEMP\NTFSSecurity.Tests,Assert-TestSandboxPathbefore each change,Remove-TestSandbox(links first, then ACL reset). Cases that need a privilege skip withTest-PrivilegeHeldand run in CI (elevated);Block-TestReadPermission(OWNER RIGHTS deny) makes a read fail without elevation. Get-Help -Onlinetests use the internal hookBypassOnlineHelpRetrieval, which PowerShell 7 ignores for the help file: 36 tests run only in Windows PowerShell.Manifest.Tests.ps1:Test-ModuleManifestclean, exactly 36 cmdlets, one version in manifest and assemblies (Decision 10).Release.Tests.ps1: release notes for the manifest version, and the packages (FileListfiles, version with label, command tags, zip layout).