Policy-as-Code Infrastructure for Windows Gaming
Elegant PowerShell translation of KENL bash functionality with the same governance principles and ATOM trail integration.
ATOM: ATOM-PWSH-20251110-001
- Small & Focused: Each module does one thing well
- Composable: Functions work together via PowerShell pipeline
- Policy-Driven: YAML-based configuration (same format as Linux)
- Cross-Platform Aware: Detects Windows/WSL2/Linux and adapts
- Audit Trail: Every action logged to ATOM trail
- SAIF Guided: Every operation includes next-step guidance
- PowerShell Native: Follows PowerShell best practices (Verb-Noun, pipeline support, proper error handling)
cd kenl\modules\KENL0-system\powershell
.\Install-KENL.ps1Import-Module KENL
Import-Module KENL.Network
Import-Module KENL.SAIF # NEW: SAIF guided operationsInitialize-Kenl
Initialize-SAIF # Initialize SAIF systemTest-KenlNetwork# Run as Administrator
Optimize-KenlNetwork -BandwidthMbps 100 -LatencyMs 40 -ApplyMTUPlatform detection, ATOM trail, configuration management
Key Functions:
Get-KenlPlatform- Detect Windows/WSL2/LinuxWrite-AtomTrail- Log to ATOM audit trailGet-AtomTrail- Read ATOM trailGet-KenlConfig- Load YAML configurationInitialize-Kenl- Set up framework
Network optimization, MTU management, latency testing
Key Functions:
Test-KenlNetwork- Test latency to known-good hostsOptimize-KenlNetwork- Apply TCP/network optimizationsSet-KenlMTU- Set optimal MTU (1492)Test-KenlMTU- Test MTU fragmentationGet-KenlNetworkProfile- Show current network config
Aliases: knet-test, knet-opt, knet-info, mtu, set-mtu, test-mtu
System-Aware Intent Flagging for guided user journeys
Key Functions:
New-SAIFFlag- Generate SAIF flags with next-step guidanceWrite-SAIFResult- Display formatted execution resultsNew-CTFWIHandover- Create handover documentsGet-SAIFTrail- Query SAIF trail entriesShow-SAIFTrail- Display formatted SAIF trailInitialize-SAIF- Initialize SAIF system
Aliases: saif, saif-show, saif-handover
SAIF ensures users always know what to do next after every operation:
# Generate a SAIF flag with guidance
$result = New-SAIFFlag -Action 'CONFIG' -Subject 'MTU' `
-Description 'MTU set to 1492' `
-NextSteps @('Verify with: ping 8.8.8.8', 'Check logs at: ~/.kenl/logs/') `
-RollbackCommand 'Set-KenlMTU -MTU 1500'
# Display the result with next-step guidance
Write-SAIFResult -SAIFResult $result -ShowDetails
# Output:
# ╔════════════════════════════════════════════════════════════╗
# ║ SAIF Execution Result ║
# ╚════════════════════════════════════════════════════════════╝
#
# ✅ MTU set to 1492
#
# SAIF Flag: SAIF-CONFIG-20251125-001
#
# 📋 Next Steps:
# → Verify with: ping 8.8.8.8
# → Check logs at: ~/.kenl/logs/
#
# 📁 Log: ~/.kenl/logs/network.log
# ↩️ Rollback: Set-KenlMTU -MTU 1500Create handover documents for transitions between phases:
New-CTFWIHandover -Title "Disk Preparation Complete" -Phase "Step 2" `
-CompletedActions @("Disk wiped", "GPT created", "Partitions formatted") `
-NextActions @("Boot Bazzite Live USB", "Run installation") `
-CriticalNotes @("Do not interrupt partitioning", "Keep USB inserted")
# Creates: ~/Desktop/HANDOVER-Disk-Preparation-Complete-20251125-123456.mdSee COMMAND-STRUCTURE.md for complete command reference, aliases, and examples.
# Platform
Get-KenlPlatform # Detect platform
Get-KenlInfo # Show KENL info
# ATOM Trail
Write-AtomTrail -Action "Test" # Log entry
Get-AtomTrail -Last 10 # View last 10 entries
# Network
Test-KenlNetwork # Test latency
Optimize-KenlNetwork -BandwidthMbps 100 -LatencyMs 40
Set-KenlMTU -MTU 1492 # Set optimal MTU
Get-KenlNetworkProfile # Show config
# Using aliases
knet-test # Test network
knet-opt -BandwidthMbps 100 -LatencyMs 40
mtu # Show MTUBased on your network analysis (ATOM-NETWORK-20251110-001):
# 1. Test current network
Test-KenlNetwork
# Output:
# Testing Best CDN (199.60.103.31)... 42ms [GOOD]
# Testing Akamai (23.46.33.251)... 38ms [EXCELLENT]
# Average Latency: 40ms
# 2. Check MTU
Get-KenlMTU
# 3. Apply optimizations (requires Administrator)
Optimize-KenlNetwork -BandwidthMbps 100 -LatencyMs 40 -ApplyMTU
# Output:
# [✓] TCP parameters configured
# [✓] Network adapter optimized
# [✓] MTU set to 1492
# [✓] QoS policies created
# ATOM-NETWORK-20251110-002 logged
# 4. Verify
Get-KenlNetworkProfile
# 5. Reboot for full effect
Restart-ComputerCreate on Windows:
$profile = @{
hardware_profile = @{
id = "HW-RYZEN5-5600H-VEGA-001"
cpu = @{
model = "AMD Ryzen 5 5600H"
cores = 6
}
gpu = @{
model = "AMD Radeon Vega"
}
}
}
$profile | ConvertTo-Yaml | Out-File my-hardware.yamlUse on Linux (Bazzite):
# Same YAML file works!
kenl gaming optimize-hardware --profile my-hardware.yamlCreate a YAML policy that works on both Windows and Linux:
# gaming-network-policy.yaml
policy:
name: "Gaming Network Optimization"
atom: "ATOM-POLICY-20251110-001"
network:
mtu: 1492
bandwidth_mbps: 100
latency_ms: 40
hosts:
priority:
- 199.60.103.31 # Best CDN
- 23.46.33.251 # Akamai
- 18.67.110.92 # AWSApply on Windows:
$policy = Get-KenlConfig -Path gaming-network-policy.yaml
Optimize-KenlNetwork -BandwidthMbps $policy.network.bandwidth_mbps `
-LatencyMs $policy.network.latency_ms `
-ApplyMTU- Windows: PowerShell 5.1+ (included in Windows 10/11)
- Optional:
powershell-yamlmodule for full YAML supportInstall-Module powershell-yaml -Scope CurrentUser
powershell/
├── KENL.psm1 # Core module (platform, ATOM, config)
├── KENL.psd1 # Core module manifest
├── KENL.Network.psm1 # Network optimization
├── KENL.Network.psd1 # Network module manifest
├── KENL.SAIF.psm1 # SAIF guided operations (NEW)
├── KENL.SAIF.psd1 # SAIF module manifest (NEW)
├── Install-KENL.ps1 # Installer
├── COMMAND-STRUCTURE.md # Complete command reference
└── README.md # This file
| Task | Bash (Linux) | PowerShell (Windows) |
|---|---|---|
| Test network | ./monitor-network-gaming.sh |
Test-KenlNetwork |
| Optimize network | sudo ./optimize-network-gaming.sh 100 40 |
Optimize-KenlNetwork -BandwidthMbps 100 -LatencyMs 40 |
| Set MTU | sudo ip link set dev eth0 mtu 1492 |
Set-KenlMTU -MTU 1492 |
| Show config | cat config.yaml |
Get-KenlConfig -Path config.yaml |
| ATOM trail | echo "test" >> atom_trail.log |
Write-AtomTrail -Action "test" |
| Platform check | uname -a |
Get-KenlPlatform |
-
Gaming Module (coming soon):
- Play Card creation
- Hardware profile management
- Gaming optimization
-
System Module (coming soon):
- System information
- Hardware detection
- Driver management
-
WSL2 Integration:
- Seamless cross-platform execution
- Share configurations between Windows and WSL2
These modules mirror the bash KENL functionality with PowerShell idioms:
- Small, focused functions
- Pipeline support
- Proper error handling
- WhatIf/Confirm support
- Help documentation
- COMMAND-STRUCTURE.md - Complete command reference
- Network Analysis - Your network optimization results
- Hardware Profile - Your AMD Ryzen 5 5600H profile
All operations are logged to ~/.kenl/atom_trail.log with cryptographic-grade audit trail:
[2025-11-10 15:30:45] [ATOM-PWSH-20251110-001] [Windows] KENL framework initialized
[2025-11-10 15:31:22] [ATOM-NETWORK-20251110-002] [Windows] Network optimized: 100Mbps, 40ms, BDP=500KB
[2025-11-10 15:31:45] [ATOM-NETWORK-20251110-003] [Windows] MTU set to 1492 on Ethernet
Version: 1.0.0 ATOM: ATOM-PWSH-20251110-001 License: Same as KENL framework