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.7 KiB
5.7 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. - GitHub renders the docs (Decision 9), and CI publishes them to the wiki
(Decision 11). The MarkdownLinkCheck step covers only relative links in
Docsand ignores anchors;Tests\Wiki.Tests.ps1checks every link of the generated wiki, including anchors (GitHub's slug rules: lowercase, punctuation removed, spaces to hyphens). Check the links inREADME.mdandCHANGELOG.mdseparately. - The wiki is generated: edit
Docs, never the wiki.Export-WikiContent.ps1names a page after its file (Docs/README.mdbecomes Home), rewrites links, and builds the sidebar from the cmdlet groups ofDocs/README.md; a cmdlet missing there failsWiki.Tests.ps1. - platyPS rewrites non-ASCII punctuation such as em dashes; keep cmdlet pages ASCII-only.
- In cmdlet pages, end a sentence with a link: platyPS renders a link as
text (url)in the help file and drops the space after it. - Verify examples in a
$env:TEMPsandbox, never on real data; parse every example and check its parameters againstGet-Commandmetadata.
Testing the module
- Pester 5 tests in
Tests/*.Tests.ps1importNTFSSecurity\bin\Release\NTFSSecurity.psd1; CI runs them in Windows PowerShell 5.1 and in PowerShell 7 (Decision 11). Get-Help -Onlineis tested with the internal test hookBypassOnlineHelpRetrieval, which returns the URI instead of opening a browser. In PowerShell 7 the hook also skips the help file, so that test runs only in Windows PowerShell (36 skipped tests in PowerShell 7); PowerShell 7 resolves the same URI..github/scripts/Invoke-Tests.ps1runs Pester for CI: the counts and the failed tests go to the job summary, the NUnit file to thetest-resultsartifact, and it fails on failed test files too (Result -ne 'Passed').Tests\Manifest.Tests.ps1checks the built manifest:Test-ModuleManifestwithout errors or warnings, exactly 36 cmdlets, and the same version in the manifest and the assemblies (Decision 10). Add a new cmdlet toCmdletsToExportand to the expected count in the same change.Tests\Release.Tests.ps1checks thatCHANGELOG.mdhas release notes for the manifest version (dated section, or[Unreleased]for a prerelease) and the packages: onlyFileListfiles, version with label, command tags, andNTFSSecurity.zipwith the module folder.