-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknowledge-graph.jsonl
More file actions
52 lines (52 loc) · 18.5 KB
/
knowledge-graph.jsonl
File metadata and controls
52 lines (52 loc) · 18.5 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{"type":"entity","name":"Memory MCP Server Setup","entityType":"Configuration Task","observations":["Memory MCP server successfully configured on 2025-12-08","Knowledge graph file location: ${workspaceFolder}/knowledge-graph.jsonl","Workspace-level .vscode/mcp.json configuration active with correct 'servers' key","Global Memory server removed to allow workspace-level config to take precedence","File format: JSONL (JSON Lines) for Memory MCP server compatibility","Fresh knowledge graph generation with workspace isolation","Ready for git backup and cross-machine sync across machines"]}
{"type":"entity","name":"PowerShellScripts","entityType":"GitHub Repository","observations":["Repository: J-MaFf/PowerShellScripts on GitHub","Production PowerShell scripts organized by task (AD/, Date format/, Misc/, etc.)","Reusable modules in Modules/ directory","Requires cryptographically signed commits on main branch","SSH signing with ED25519 key (1Password managed)","Custom development guide in .github/copilot-instructions.md","All remote branches tracked locally"]}
{"type":"entity","name":"Commit Signing Workflow","entityType":"Development Process","observations":["SSH signing required: ED25519 key","Git editor: VS Code (code --wait)","Web-based Copilot agents create unsigned commits via GitHub API","Solution: git rebase --exec 'git commit --amend --no-edit -S' main && git push --force-with-lease","Procedure documented in .github/copilot-instructions.md"]}
{"type":"entity","name":"PowerShellScripts Testing","entityType":"Project","observations":["Rebuilt SFA test suite from scratch with Pester 5.7.1 - replaced large regex-heavy test files that caused VS Code freezing","Move-ExpiredUserCertificates.Tests.ps1: 11 tests, focuses on date parsing and archive folder logic","Export-UserCertificates.Tests.ps1: 15 tests, validates parameters, file operations, and error handling","Publish-SFACertificates.Tests.ps1: 30 tests, checks branch mapping, connectivity, and copy operations","All tests use focused functional validation instead of excessive pattern matching on script content","New approach is compatible with Pester extension installed in VS Code","Total: 56 tests, all passing, no VS Code freezing"]}
{"type":"entity","name":"ActiveDirectoryUtils Module","entityType":"PowerShell Module","observations":["Located in Modules/ActiveDirectoryUtils/ with manifest at ActiveDirectoryUtils.psd1","Version 1.4.0, supports both Desktop and Core PowerShell editions","Wraps Get-ADUser logic and auto-installs RSAT if missing on elevated sessions","Core functions: Initialize-ActiveDirectorySupport, Get-ADPasswordExpiryInfo, Get-ADUserLastLogonComputer, Get-ADComputerLastLogon","Implements limited-mode flag when AD cmdlets unavailable, surfaces warnings instead of throwing errors","All scripts under Scripts/ActiveDirectory/ import this module explicitly via relative paths, no requires -Modules needed","Pester test suite in Tests/ActiveDirectory/ with 100% pass rate"]}
{"type":"entity","name":"RegistryUtils Module","entityType":"PowerShell Module","observations":["Located in Modules/RegistryUtils/, formerly known as UserDateFormatUtils","Centralizes remoting helpers (WinRM fallback, user profile registry handling, CSV export) and credential acquisition","Exports DateFormat functions: Get-UserSystemShortDateFormat, Set-RemoteUserDateFormat, Invoke-RemoteCommand","Exports RegionFormat functions: Get-UserRegionFormat, Set-UserRegionFormat, Test-ServerConnectivity","Shared helpers: Get-RemoteUserProfiles, Get-TargetUsersList, Export-UserDateFormatCsv","Handles HKU:\\ registry hive loading/unloading with proper resource cleanup patterns","All DateFormat and RegionFormat scripts must import this module and reuse utilities rather than reimplementing remoting","Pester test suite in Tests/DateFormat/ (72 tests) and Tests/RegionFormat/ (49 tests) with 100% pass rate"]}
{"type":"entity","name":"PersonalUtils Module","entityType":"PowerShell Module","observations":["Located in Modules/PersonalUtils/","Exposes Copilot/terminal helpers and GitHub CLI integration","Depends on external CLIs: GitHub CLI (gh) and 1Password CLI (op)","Primary function: Invoke-GitHubCopilotSuggest (alias ghcs) for intelligent command suggestions","Reuse these functions when integrating Copilot prompts or shell shortcuts","Provides terminal productivity enhancements for developers"]}
{"type":"entity","name":"ActiveDirectory Script Category","entityType":"Script Category","observations":["Located in Scripts/ActiveDirectory/","Focuses on AD user and computer management","Key scripts: Get-UserComputer.ps1 (finds last logon workstation via event 4624), Get-ComputerLastOnline.ps1, Get-PasswordExpiryInfo.ps1","All scripts require Windows PowerShell 5.1+ and import ActiveDirectoryUtils module","Support optional -Credential parameter for delegated access","Implement graceful elevation prompts using Start-Process -Verb RunAs when admin rights needed","Scripts can be run directly on fresh clones without PSModulePath setup"]}
{"type":"entity","name":"DateFormat Script Category","entityType":"Script Category","observations":["Located in Scripts/Registry/DateFormat/","Manages and standardizes date formats across user profiles on remote servers","Key scripts: Get-UserDateFormats.ps1, Set-UserDateFormats.ps1","Both load RegistryUtils module and support -Credential parameter and 1Password retrieval","Support -TargetUsers/-UserListFile filtering for batch operations","Export consolidated CSVs to Output/DateFormats/ with timestamped filenames","Pester test suite with 72 tests, 100% pass rate"]}
{"type":"entity","name":"RegionFormat Script Category","entityType":"Script Category","observations":["Located in Scripts/Registry/RegionFormat/","Manages and standardizes region/locale formats across user profiles","Key scripts: Get-UserRegionFormats.ps1, Set-UserRegionFormats.ps1","Support culture code parameters (e.g., en-US, nl-NL) for region customization","Use case: Fixes Crystal Reports Dutch text issue with region format configuration","Load RegistryUtils module, support -Credential parameter, iterate over servers","Export CSVs to Output/RegionFormats/ with timestamped filenames","Pester test suite with 49 tests, 100% pass rate"]}
{"type":"entity","name":"SFA Script Category","entityType":"Script Category","observations":["Located in Scripts/SFA/ (Secure File Access or similar)","Handles certificate export and management workflows","Key script: Export-UserCertificates.ps1 exports PFX certificates from Windows Certificate Store","Implements per-user password protection via domain usernames from Active Directory","Filename convention: Full Name - AD Username - YYYYMMDD.pfx","Supports local or remote execution via -ComputerName parameter","Summary file reports failed exports at beginning and end for tracking","Pester test suite in Tests/SFA/"]}
{"type":"entity","name":"Credential and Remoting Patterns","entityType":"Design Pattern","observations":["All remoting operations should go through Invoke-RemoteCommand from RegistryUtils for automatic PowerShell 7 → 5.1 → auth fallbacks","Scripts support optional -Credential parameter for PSCredential objects, eliminating interactive prompts","1Password environment variables: OP_KFI_USERNAME/OP_KFI_PASSWORD for KFI domain, OP_KGS_USERNAME/OP_KGS_PASSWORD for KGS domain","Fallback chain: 1Password credentials → -Credential parameter → Get-Credential prompt","When touching user registry hives, load HKU:\\<SID> only when necessary and always unload if you loaded it","Script blocks passed to Invoke-Command must use typed parameters for secure string serialization, never rely on closure-captured variables","Hashtables in Invoke-Command -ArgumentList must be checked with .ContainsKey() and explicitly converted within script block"]}
{"type":"entity","name":"Module Import Pattern","entityType":"Design Pattern","observations":["All scripts use explicit relative-path module imports instead of PSModulePath lookups","Standard import pattern: $scriptDir = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Path }","Traverse to repo root: $repoRoot = Split-Path -Parent (Split-Path -Parent $scriptDir)","Import module: Import-Module -Name (Join-Path $repoRoot 'Modules\\ModuleName\\ModuleName.psd1')","This pattern works both when scripts are directly invoked and when dot-sourced","No requires -Modules directive needed; scripts work on fresh clones without PSModulePath configuration","Check module already loaded before importing: if (-not (Get-Module -Name ModuleName)) { Import-Module ... }"]}
{"type":"entity","name":"Script Output Convention","entityType":"Design Pattern","observations":["Outputs stored under Output/ directory with category subdirectories","Subdirectory examples: Output/DateFormats/, Output/RegionFormats/, Output/EndpointCentral/, Output/DisasterRecovery/, Output/SFA/, Output/Reports/","Timestamped filenames follow pattern: ScriptName_Output_YYYYMMDD_HHMMSS.csv","CSV exports should use Export-UserDateFormatCsv or similar shared helper from modules to maintain consistency","Keep directory structure organized by output type/category for easy tracking and archival","Implement comprehensive summary reporting for long-running jobs (especially certificate export)"]}
{"type":"entity","name":"Testing Pattern - Pester","entityType":"Testing Pattern","observations":["All scripts have adjacent Pester test files: <ScriptName>.Tests.ps1 in Tests/ subdirectories","Test structure: Tests/ActiveDirectory/, Tests/DateFormat/, Tests/RegionFormat/, Tests/SFA/, Tests/WindowsUpdate/","Use BeforeAll to set up mocks and import modules before running test suite","Always mock external cmdlets (Get-ADUser, Get-HotFix, Out-GridView, Get-Module, Get-Date, etc.) to prevent side effects","Mock example: Mock -CommandName Get-Module -ParameterFilter { $Name -eq 'ActiveDirectory' -and -not $ListAvailable } -MockWith { [pscustomobject]@{ Name = 'ActiveDirectory' } }","Avoid dot-sourcing scripts with admin/version requirements in non-admin test context; analyze content with Get-Content -Raw instead","Create temporary script copies with requirement lines removed if function access needed in tests","All test suites have 100% pass rate; run: Invoke-Pester -Script 'Tests/<Category>/'"]}
{"type":"entity","name":"Script Safety and UX Patterns","entityType":"Design Pattern","observations":["Treat scripts as shipping artifacts: most have comment-based help, emoji-rich Write-Host messaging, and default to safe read-only actions","Default to read-only operations unless parameter explicitly opts in to mutation (follow -WhatIf/-Confirm pattern)","Favor Write-Host with emojis and color to match existing operator feedback style","Honor elevation UX: warn when admin rights missing, offer elevation via Start-Process -Verb RunAs, preserve original arguments on rerun","Detect current elevation: [Security.Principal.WindowsPrincipal]::new([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)","Use host.UI.PromptForChoice for interactive yes/no decisions","Provide clear, actionable error messages and avoid silent failures"]}
{"type":"entity","name":"External Module Auto-Install Pattern","entityType":"Design Pattern","observations":["Scripts with #Requires -Modules directive should include auto-install logic for external modules (PSWindowsUpdate, Az.*, etc.)","Check if module exists before installing: if (-not (Get-Module -ListAvailable -Name ModuleName)) { Install-Module -Name ModuleName -Scope CurrentUser -Force }","Use Scope CurrentUser by default; only use Scope AllUsers if documented and required","Provide user feedback with emoji prefix before/after installation (e.g., '📦 Installing PSWindowsUpdate module...')","Surface warnings instead of hard failures when optional dependencies unavailable; follow ActiveDirectoryUtils limited-mode pattern","Example: PSWindowsUpdate module auto-installs on demand, with clear messaging"]}
{"type":"entity","name":"PowerShell Version and Compatibility","entityType":"Development Constraint","observations":["Prefer PowerShell 7+ for new scripts; only target Windows PowerShell 5.1 when legacy compatibility required","Include #Requires -Version directive (e.g., #Requires -Version 5.1)","All module manifests specify: PowerShellVersion = '5.1', CompatiblePSEditions = @('Desktop', 'Core')","Scripts may include #Requires -RunAsAdministrator when elevated rights needed for core functionality","When running on both PowerShell 5.1 and 7+, use: $PSVersionTable.PSEdition -eq 'Core' to detect pwsh vs powershell.exe","For cross-version execution, use Invoke-RemoteCommand from RegistryUtils for automatic fallback handling"]}
{"type":"entity","name":"Comment-Based Help and Documentation","entityType":"Development Pattern","observations":["Comment-based help is mandatory for all new scripts and functions using standard PowerShell help block pattern","Include sections: SYNOPSIS, DESCRIPTION, PARAMETER (for each param), OUTPUTS, EXAMPLE (multiple examples preferred)","Parameter descriptions should explain purpose, type, and any special requirements","Examples should show common usage patterns and advanced scenarios","In markdown documentation: avoid backticks around PowerShell keywords (PSCustomObject, requires directives) as linters may misinterpret them","Use plain text descriptions or isolated code blocks for PowerShell-specific terms"]}
{"type":"entity","name":"Git and Commit Conventions","entityType":"Development Workflow","observations":["Repository requires cryptographically signed commits (verified signatures)","Use local git client for commits: git add, git commit -S, git push (ensures SSH key signing)","GitHub MCP server tools used for creating branches, PRs, and managing issues/reviews; local git for actual code commits","If web-based Copilot agent creates unsigned commits, fix via: git rebase --exec 'git commit --amend --no-edit -S' main && git push --force-with-lease","Commit message pattern: emoji + brief summary (imperative) + blank line + detailed bullets","Example: '🧹 Normalize whitespace in test file\\n\\n- Remove trailing whitespace\\n- Normalize blank lines for consistency'"]}
{"type":"entity","name":"Security Principles","entityType":"Development Principle","observations":["Assume everything committed to git is public, even in private repos (commits may be shared or exposed)","Never store cryptographic material in knowledge graphs, documentation, config files, or inline comments","No keys, tokens, passwords, or certificate material should ever be committed","Question sensitive data early in development rather than fixing after commit; apply security checks during initial creation","Use functional descriptions over implementation details for security-related items","Example: 'ED25519 key configured' instead of storing the actual key value","Security principles apply to Memory MCP knowledge graph, README files, inline comments, and all tracked content"]}
{"type":"entity","name":"PowerShellScripts Repository","entityType":"Project","observations":["Production PowerShell scripts repository for automation tasks","Memory MCP server connectivity test - December 16, 2025","Memory server is operational","Test entities are being created successfully"]}
{"type":"relation","from":"PowerShellScripts","to":"Memory MCP Server Setup","relationType":"implements"}
{"type":"relation","from":"PowerShellScripts","to":"Commit Signing Workflow","relationType":"enforces"}
{"type":"relation","from":"Commit Signing Workflow","to":"PowerShellScripts","relationType":"required_for"}
{"type":"relation","from":"ActiveDirectory Script Category","to":"ActiveDirectoryUtils Module","relationType":"imports and delegates to"}
{"type":"relation","from":"DateFormat Script Category","to":"RegistryUtils Module","relationType":"imports and delegates to"}
{"type":"relation","from":"RegionFormat Script Category","to":"RegistryUtils Module","relationType":"imports and delegates to"}
{"type":"relation","from":"ActiveDirectory Script Category","to":"Testing Pattern - Pester","relationType":"implements"}
{"type":"relation","from":"DateFormat Script Category","to":"Testing Pattern - Pester","relationType":"implements"}
{"type":"relation","from":"RegionFormat Script Category","to":"Testing Pattern - Pester","relationType":"implements"}
{"type":"relation","from":"SFA Script Category","to":"Testing Pattern - Pester","relationType":"implements"}
{"type":"relation","from":"ActiveDirectory Script Category","to":"Module Import Pattern","relationType":"follows"}
{"type":"relation","from":"DateFormat Script Category","to":"Module Import Pattern","relationType":"follows"}
{"type":"relation","from":"RegionFormat Script Category","to":"Module Import Pattern","relationType":"follows"}
{"type":"relation","from":"SFA Script Category","to":"Module Import Pattern","relationType":"follows"}
{"type":"relation","from":"DateFormat Script Category","to":"Credential and Remoting Patterns","relationType":"implements"}
{"type":"relation","from":"RegionFormat Script Category","to":"Credential and Remoting Patterns","relationType":"implements"}
{"type":"relation","from":"SFA Script Category","to":"Credential and Remoting Patterns","relationType":"implements"}
{"type":"relation","from":"DateFormat Script Category","to":"Script Output Convention","relationType":"follows"}
{"type":"relation","from":"RegionFormat Script Category","to":"Script Output Convention","relationType":"follows"}
{"type":"relation","from":"SFA Script Category","to":"Script Output Convention","relationType":"follows"}
{"type":"relation","from":"ActiveDirectory Script Category","to":"Script Safety and UX Patterns","relationType":"implements"}
{"type":"relation","from":"DateFormat Script Category","to":"Script Safety and UX Patterns","relationType":"implements"}
{"type":"relation","from":"ActiveDirectoryUtils Module","to":"External Module Auto-Install Pattern","relationType":"implements"}
{"type":"relation","from":"ActiveDirectoryUtils Module","to":"PowerShell Version and Compatibility","relationType":"follows"}
{"type":"relation","from":"RegistryUtils Module","to":"PowerShell Version and Compatibility","relationType":"follows"}
{"type":"relation","from":"PersonalUtils Module","to":"PowerShell Version and Compatibility","relationType":"follows"}
{"type":"relation","from":"RegistryUtils Module","to":"Credential and Remoting Patterns","relationType":"provides infrastructure for"}
{"type":"relation","from":"Module Import Pattern","to":"PowerShell Version and Compatibility","relationType":"enables cross-version support for"}
{"type":"relation","from":"Git and Commit Conventions","to":"Development Workflow","relationType":"defines"}
{"type":"relation","from":"Security Principles","to":"Development Principle","relationType":"is instance of"}