Conversation
- Add C# project (src/ModuleFast/ModuleFast.csproj) targeting net8.0 - Implement ModuleFastSpec in C# with full NuGet version range support - Implement ModuleFastInfo in C# with IComparable and implicit ModuleSpecification conversion - Add ModuleFastClient HTTP client factory helper - Add stub binary cmdlets: GetModuleFastPlanCommand, ClearModuleFastCacheCommand - Remove PowerShell class definitions from ModuleFast.psm1 - Register type accelerators for ModuleFastSpec and ModuleFastInfo in psm1 - Update ModuleFast.psd1 to export binary cmdlets - Update ModuleFast.build.ps1 with BuildCSharp task - Update .gitignore to exclude build artifacts - Add ModuleFast.slnx solution file All 7 non-E2E Pester tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…pdate-TypeData Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: JustinGrote <15258962+JustinGrote@users.noreply.github.com> Agent-Logs-Url: https://github.com/JustinGrote/ModuleFast/sessions/eac9df56-fca6-48d7-8e04-c899cdbbb277
|
@copilot Convert the following powershell functions and any dependent functions into C# Cmdlets: |
- Add InstallModuleFastCommand, GetModuleFastPlanCommand, ClearModuleFastCacheCommand, ImportModuleManifestCommand cmdlets - Add ModuleFastPlanner (async HTTP planning with Task.WhenAll) - Add ModuleFastInstaller (parallel download+extract, no runspaces) - Add ModuleManifestReader (handles dynamic .psd1 manifests) - Add LocalModuleFinder (searches PSModulePaths for installed modules) - Add SpecFileReader (ModuleFast/PSResourceGet/PSDepend spec file formats) - Add PathHelper (PSModulePath management, profile updates) - Add ModuleFastCache (singleton ConcurrentDictionary request cache) - Add NuGetModels (JSON models for NuGet v3 Registration API) - Update ModuleFastInfo: make ModuleVersion, Location, Guid settable; IsLocal computed - Update ModuleFastClient: add PSCredential support, ToAuthHeader, HTTP/3 - Update ModuleFast.psm1: simplified to DLL load + type accelerators only - Update ModuleFast.psd1: FunctionsToExport=@(), CmdletsToExport with all 4 cmdlets - Update ModuleFast.tests.ps1: remove InModuleScope wrapper (Import-ModuleManifest is now a public cmdlet) - Add SpecFileType and InstallScope enums in C# Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Done in commit
|
|
@copilot Reconfigure to use Artifacts Output Layout and Central Package Management |
…ge Management (Directory.Packages.props) Co-authored-by: JustinGrote <15258962+JustinGrote@users.noreply.github.com> Agent-Logs-Url: https://github.com/JustinGrote/ModuleFast/sessions/74b5c2fa-04b4-44e8-830a-7e868b2d0871
Done in commit Artifacts Output Layout (
Central Package Management (
|
Completes the migration of ModuleFast from a monolithic PowerShell script to a fully C# binary module. All public and private PowerShell functions are converted to C# cmdlets and helper classes.
ModuleFast.psm1is reduced to DLL loading and type accelerator registration only.C# project structure
ModuleFast.slnx— SLNX solution filesrc/ModuleFast/ModuleFast.csproj— targetsnet8.0;PackageReferenceentries carry no versions (governed byDirectory.Packages.props)Directory.Build.props— enables the .NET SDK Artifacts Output Layout (UseArtifactsOutput=true)Directory.Packages.props— Central Package Management; declaresMicrosoft.PowerShell.SDK 7.4.6andNuGet.Versioning 6.8.0C# types (replacing PowerShell classes)
ModuleFastSpec— full port of the PS class; parses>=,<=,=,:,>,<,!shorthand intoNuGet.Versioning.VersionRange; implementsIComparable/IEquatable<ModuleFastSpec>and implicit conversion toModuleSpecificationModuleFastInfo— port of the PS result type;IComparable, implicitModuleSpecificationconversion;ModuleVersion,Location,Guidare mutable (required by the installer)ModuleFastClient—HttpClientfactory withPSCredentialsupport, HTTP/3 opt-in, explicit decompression methodsNew C# helper classes
NuGetModels—System.Text.Jsonmodels for the NuGet v3 Registration APIModuleFastCache— singletonConcurrentDictionary-based HTTP request cache (replaces$SCRIPT:RequestCache)ModuleManifestReader— imports.psd1manifests including dynamic-expression manifests viaScriptBlock.CheckRestrictedLanguage; fast version line scanLocalModuleFinder— searchesPSModulePathfor installed modules matching a spec; handles versioned and classic module layouts; case-insensitive on Linux/MacSpecFileReader— reads and converts ModuleFast / PSResourceGet / PSDepend spec files (.psd1,.json,.ps1,.psm1); auto-detects formatPathHelper— managesPSModulePathenv var and user profile; accesses the default module path via reflection into the privatePowerShellConfigAPI;InstallScopeenumModuleFastPlanner— async parallel resolution loop usingTask.WhenAny; NuGet v3 paging; all HTTP requests cachedModuleFastInstaller— parallel download andZipArchiveextraction usingTask.WhenAll— no runspaces, noStart-ThreadJobBinary cmdlets
Install-ModuleFastInstall-ModuleFast+Install-ModuleFastHelper(all 3 parameter sets)Get-ModuleFastPlanGet-ModuleFastPlanClear-ModuleFastCacheClear-ModuleFastCacheImport-ModuleManifestImport-ModuleManifest(now a public exported cmdlet)psm1 / psd1 changes
ModuleFast.psm1probesartifacts/bin/ModuleFast/debug/, thenartifacts/bin/ModuleFast/release/, then falls back to the classic deployedbin/ModuleFast/path; registers type accelerators for[ModuleFastSpec],[ModuleFastInfo],[SpecFileType], and[InstallScope];OnRemoveblock cleans them upModuleFast.psd1:FunctionsToExport = @(),CmdletsToExportlists all 4 binary cmdletsTest updates
ModuleFast.tests.ps1: allInModuleScopewrappers removed —ModuleFastSpecandImport-ModuleManifestare now public binary types/cmdlets accessible without module scopeModuleFast.psd1(manifest) rather than directly dottingModuleFast.psm1Build integration
ModuleFast.build.ps1:BuildCSharptask drops the-oflag (artifacts path managed by the SDK);CopyFilestask reads fromartifacts/bin/ModuleFast/release/when staging the module outputGetNugetVersioningAssembly/AddNugetVersioningAssemblyRequiredtasks are superseded by the NuGet package reference inDirectory.Packages.propsartifacts/added to.gitignore⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.