Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# Changelog

## [8.0.0] - 2026-07-14

### Added
- **Orchestration Engine** (`Orchestration`): declarative Task model with dependencies, prerequisites, retry policy, and rollback
- DAG resolver (`Get-TopologicalTaskOrder`) with cycle detection for deterministic execution order
- Event Bus for structured, subscribable deployment events (`Subscribe-OrchestrationEvent`, `Publish-OrchestrationEvent`, `Get-OrchestrationEventLog`)
- State Manager tracking subsystem health (`Set-SubsystemState`, `Get-SubsystemState`, `Get-OrchestrationStateReport`, `Reset-OrchestrationState`)
- Transaction Engine recording per-task state transitions (`Start-OrchestrationTransaction`, `Record-TaskTransaction`, `Get-OrchestrationTransactionLog`)
- Desired-State model (`Get-DefaultDesiredState`, `Get-DesiredState`) with Configuration Providers (Service, Firewall, Network, Sharing, IPP, Registry, Driver, Printer)
- Orchestrator (`Invoke-Orchestrator`) executing the dependency graph with skip/retry/rollback/recovery semantics
- Recovery Engine (`Invoke-RecoveryEngine`) and consolidated reporting (`Get-OrchestrationReport`)
- Orchestration module added to manifest `NestedModules` and `FunctionsToExport`

### Changed
- `Start-ZeroTouchDeployment` refactored to build a deployment DAG and run through `Invoke-Orchestrator`; public signature and return shape preserved
- Version unified to 8.0.0 across all source files (manifest, loader, installer, utilities, rollback, docs, tests)

## [7.0.0] - 2026-07-14

### Added
- **Zero-Touch Deployment Engine** (`ZeroTouch`): Single-action print server deployment following the lifecycle Detect → Analyze → Backup → Configure → Validate → Rollback → Report
- `Start-ZeroTouchDeployment`: one-click deployment of a connected USB printer as a shared print server
- `Invoke-GuidedRecovery`: repairs only the failing validation layers (driver, queue, spooler, share, firewall, network discovery, IPP, SMB, client access) without repeating successful steps
- `Get-DeploymentHealth` / `Get-ZeroTouchDashboard`: color-coded health score and live system status across printer, driver, share, firewall, IPP, SMB, network, and services
- `Get-ClientConnectionInfo`: per-OS connection strings (Windows SMB, macOS, Android/Mopria, Linux CUPS) with prerequisites and QR payloads
- Per-deployment transaction log: separate Operation, Change, Repair, Validation, and Rollback logs under `$env:TEMP\PrinterToolkit_ZeroTouch`
- `Test-DriverSignature`: validates driver digital signature, signer, and status via `Get-AuthenticodeSignature`
- Dashboard menu entry `[Z] Zero-Touch Deployment`

### Changed
- Version unified to 7.0.0 across all source files (manifest, loader, installer, utilities, rollback, docs, tests)
- New ZeroTouch module added to manifest `NestedModules` and `FunctionsToExport`

## [6.0.0] - 2026-07-14

### Added
- Complete transformation from Printer Repair Toolkit to Automated Windows Print Server Deployment Platform
- **Print Server Wizard** (`SetupWizard`): 11-step guided wizard — USB detection → driver install → Windows features → registry → firewall → network → sharing → IPP → SMB → validation → test page + connection info
- **Validation Dashboard** (`Validation`): End-to-end PASS/FAIL dashboard checking printer, driver, queue, port, spooler, services, registry, firewall, sharing, SMB, IPP, network, Android compatibility, and test page
- **Detection Engine** (`Detection`): USB printer detection with VID, PID, Hardware IDs, Compatible IDs, manufacturer, model, and connection protocol
- **Configuration Intelligence Engine** (`Configuration`): Windows Features, Services, Registry, and Firewall inspection with expected-vs-actual comparison
- **Driver Intelligence Engine** (`Drivers`): Full driver detection — VID/PID, Hardware IDs, Compatible IDs, manufacturer, model, driver store package, driver version, Type 3/4, architecture, WHQL status, signature verification
- **Automatic Repair Engine** (`Repair`): Complete repair cycle — Issue → Root Cause → Backup → Repair → Validate → Success or Rollback. Never leaves partial repairs
- **Rollback Engine** (`Rollback`): Full configuration rollback — registry, services, printers, and network restore points with one-command restore
- **Networking Module** (`Networking`): Network profile management, firewall rule management, IPP/WSD/File & Printer Sharing rule configuration
- **SMB Configuration Module** (`SMB`): SMB 1.0/2/3 protocol configuration, SMB server settings, printer share enumeration
- **Client Connectivity** (`Android`): Connection strings for Windows (`\\ComputerName\Share`), SMB, IPP (`ipp://hostname/printers/Printer`), HTTP (`http://hostname:631/printers/Printer`), with QR code content generation
- **Get-ConnectionInfo**: Generates structured connection information for all shared printers
- **New-ConnectionQRCode**: Generates IPP URL, Setup Guide, and Troubleshooting Guide QR code content
- **Markdown report format** in `New-PrinterReport -Format Markdown`
- 18 specialized submodules (up from 11)
- 66+ exported functions (up from 55)

### Changed
- Version unified to 6.0.0 across all source files
- Module manifest updated with new module paths and v6.0 description
- Root module (`PrinterToolkit.psm1`) restructured menu with Print Server Wizard, Validation Dashboard, Connection Info sections
- Repair module rewritten with `Invoke-RepairCycle` for atomic issue→rootcause→backup→repair→validate→rollback
- Reporting module enhanced with Markdown format and validation dashboard integration
- Driver module enhanced with `Get-DriverIntelligence` for comprehensive driver detection
- Android module enhanced with `Get-ConnectionInfo` and `New-ConnectionQRCode`
- Bundle module enhanced with validation dashboard collection
- Logging module enhanced with component tracking
- Core module enhanced with `Get-PrinterWmiDetail`
- Test suite expanded to cover all 18 modules and 66+ functions
- README completely rewritten for v6.0 print server platform focus

## [5.0.2] - 2026-07-14

### Fixed
Expand Down
29 changes: 21 additions & 8 deletions CI/build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#
.SYNOPSIS
CI build script for PrinterToolkit v5.0.1.
CI build script for PrinterToolkit.

.DESCRIPTION
Runs linting, Pester tests, module analysis, and packaging.
Expand Down Expand Up @@ -32,6 +32,16 @@ param(
$ModuleRoot = Split-Path -Parent $PSScriptRoot
$Timestamp = Get-Date -Format 'yyyyMMdd_HHmmss'

$buildFailed = $false
$toolkitVersion = '8.0.0'
$manifestPath = Join-Path -Path $ModuleRoot -ChildPath 'PrinterToolkit.psd1'
if (Test-Path -Path $manifestPath) {
$manifestData = Import-PowerShellDataFile -Path $manifestPath -ErrorAction SilentlyContinue
if ($manifestData -and $manifestData.ModuleVersion) {
$toolkitVersion = $manifestData.ModuleVersion.ToString()
}
}

function Write-Step {
param([string]$Message, [string]$Status = 'INFO')
$color = switch ($Status) {
Expand All @@ -42,17 +52,19 @@ function Write-Step {
}

Write-Host '========================================' -ForegroundColor Cyan
Write-Host ' PrinterToolkit v5.0.1 Build Script' -ForegroundColor White
Write-Host " PrinterToolkit v$toolkitVersion Build Script" -ForegroundColor White
Write-Host ' Configuration: ' -NoNewline; Write-Host $Configuration -ForegroundColor Yellow
Write-Host '========================================' -ForegroundColor Cyan
Write-Host ''

# Step 1: Validate module structure
Write-Step 'Validating module structure...'
$expectedDirs = @(
'Modules\Core', 'Modules\IPP', 'Modules\Logging', 'Modules\Utilities',
'Modules\Android', 'Modules\Diagnostics', 'Modules\Repair',
'Modules\Drivers', 'Modules\Sharing', 'Modules\Reporting', 'Modules\Bundle'
'Modules\Core', 'Modules\Detection', 'Modules\Configuration', 'Modules\Drivers',
'Modules\Networking', 'Modules\IPP', 'Modules\SMB', 'Modules\Sharing',
'Modules\Android', 'Modules\Diagnostics', 'Modules\Repair', 'Modules\Rollback',
'Modules\Validation', 'Modules\SetupWizard', 'Modules\Reporting', 'Modules\Logging',
'Modules\Utilities', 'Modules\Bundle'
)
$missingDirs = @()
foreach ($dir in $expectedDirs) {
Expand All @@ -61,6 +73,7 @@ foreach ($dir in $expectedDirs) {
}
if ($missingDirs.Count -gt 0) {
Write-Step "Missing directories: $($missingDirs -join ', ')" 'FAIL'
$buildFailed = $true
} else {
Write-Step 'All module directories present' 'OK'
}
Expand All @@ -74,6 +87,7 @@ foreach ($f in $expectedFiles) {
}
if ($missingFiles.Count -gt 0) {
Write-Step "Missing files: $($missingFiles -join ', ')" 'FAIL'
$buildFailed = $true
} else {
Write-Step 'Core module files present' 'OK'
}
Expand All @@ -91,7 +105,6 @@ foreach ($script in $allScripts) {
$syntaxErrors += $script.Name
}
}
$buildFailed = $false
if ($syntaxErrors.Count -gt 0) {
Write-Step "Syntax errors in: $($syntaxErrors -join ', ')" 'FAIL'
$buildFailed = $true
Expand Down Expand Up @@ -153,7 +166,7 @@ try {

# Step 6: Package
if (-not $OutputDir) {
$OutputDir = Join-Path -Path $ModuleRoot -ChildPath "artifacts\PrinterToolkit_v5.0.1_$Timestamp"
$OutputDir = Join-Path -Path $ModuleRoot -ChildPath "artifacts\PrinterToolkit_v$toolkitVersion_$Timestamp"
}
$null = New-Item -ItemType Directory -Force -Path $OutputDir

Expand All @@ -173,7 +186,7 @@ try {

# Generate manifest
$buildManifest = @{
Version = '5.0.1'
Version = $toolkitVersion
BuildDate = (Get-Date -Format 'yyyy-MM-dd HH:mm:ss')
Configuration = $Configuration
TotalScripts = $allScripts.Count
Expand Down
52 changes: 52 additions & 0 deletions MIGRATION_V8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Migrating from v7 (Procedural) to v8 (Orchestrated)

PrinterToolkit v8 keeps every v7 capability intact but refactors the internal
execution model. This guide is for maintainers extending the toolkit.

## What changed

| Concern | v7 | v8 |
|--------------------|-------------------------------------------------|-------------------------------------------------------------|
| Execution | Procedural helper chains (`Invoke-ZT*`) | Declarative task graph executed by `Invoke-Orchestrator` |
| Ordering | Hard-coded call sequence | Topological DAG (`Get-TopologicalTaskOrder`, cycle-checked) |
| State awareness | Ad-hoc checks | State Manager (`Set/Get-SubsystemState`) |
| Observability | Log lines only | Event Bus (`Subscribe/Publish-OrchestrationEvent`) |
| Audit | Per-deployment transaction log | Per-task transactions (`Record-TaskTransaction`) |
| Rollback / recovery| Manual rollback after full failure | Automatic retry → rollback → recovery per task |

`Start-ZeroTouchDeployment` remains backward compatible: same parameters
(`-PrinterName`, `-ShareName`, `-SkipValidation`) and same return object
(`Success`, `TransactionId`, `PrinterName`, `Detected`, `Configuration`,
`Validation`, `Health`, `RollbackPerformed`, `Errors`). Internally it now
builds an `OrchestrationTask[]` DAG and calls `Invoke-Orchestrator`.

## Adding a new operation

Prefer expressing new behavior as a **Task** rather than a new procedural
function:

```powershell
$task = New-OrchestrationTask -Name 'ConfigureFoo' -Description '...' `
-Category 'Configuration' -Subsystem 'Foo' -RequiredElevation $true `
-Dependencies @('ConfigureServices') `
-RetryPolicy @{ MaxAttempts = 2; DelayMs = 500 } `
-Execute { Invoke-ConfigurationProvider -Provider 'Foo' -Phase ApplyChanges -DesiredState $desired } `
-Validate { Invoke-ConfigurationProvider -Provider 'Foo' -Phase Validate -DesiredState $desired }
```

If the operation is a brand-new platform area, add a branch to the
`switch ($Provider)` in `Invoke-ConfigurationProvider` implementing the
phases: `GetCurrentState`, `GetDesiredState`, `PlanChanges`,
`ApplyChanges`, `Validate`, `Rollback`. Reuse existing module functions
(e.g. `Set-ServiceConfiguration`, `Enable-PrinterSharing`) — do not
duplicate Windows logic inside the provider.

## Rules

- Tasks must **not** call each other's `Execute`/`Validate` directly. The
orchestrator resolves the order from `Dependencies`.
- `RequiredElevation` is enforced automatically; the orchestrator skips
non-elevated tasks that require elevation and cascades the skip to dependents.
- `IsCritical = $false` / `CanSkip = $true` tasks never fail the whole run.
- Keep platform specifics inside the existing modules; the Orchestration
module orchestrates, it does not own Windows configuration logic.
Loading
Loading