### ModuleFast Module Specification Syntax Examples Source: https://github.com/justingrote/modulefast/blob/main/README.MD Illustrates various ways to specify module versions using ModuleFast's shorthand syntax, including exact matches, greater/less than, and NuGet version ranges. ```powershell # Exact version match Install-ModuleFast 'ImportExcel=7.1.0' # Greater than version Install-ModuleFast 'ImportExcel>7.1.0' # Greater than or equal to version Install-ModuleFast 'ImportExcel>=7.1.0' # Less than version Install-ModuleFast 'ImportExcel<7.1.0' # Less than or equal to version Install-ModuleFast 'ImportExcel<=7.1.0' # Prerelease acceptable (at start or end) Install-ModuleFast 'ImportExcel!' Install-ModuleFast '!ImportExcel' Install-ModuleFast 'ImportExcel!>7.1.0' # NuGet version range (e.g., latest 3.2.x) Install-ModuleFast 'ImportExcel:3.2.*' Install-ModuleFast 'ImportExcel:(7.0.0, 7.2.1-preview]' ``` -------------------------------- ### Generate and Execute Installation Plans Source: https://context7.com/justingrote/modulefast/llms.txt Create an installation plan to preview dependencies and versions before execution. This allows for auditing or delayed installation of module sets. ```powershell # Generate a plan $plan = Install-ModuleFast 'Az.Compute', 'Az.Storage' -Plan # Examine the plan $plan | Format-Table Name, ModuleVersion, Location # Execute the plan later $plan | Install-ModuleFast -PassThru ``` -------------------------------- ### Preview Installation Plans with -WhatIf Source: https://context7.com/justingrote/modulefast/llms.txt Use the -WhatIf switch to preview which modules will be installed without making changes. Plans can be exported to JSON and executed later. ```powershell # Preview what would be installed Install-ModuleFast 'Az.Compute', 'Az.Storage' -WhatIf # Save the plan for later execution $plan = Install-ModuleFast 'ImportExcel', 'Pester>=5.0' -WhatIf $plan | ConvertTo-Json | Out-File 'install-plan.json' # Execute a saved plan $plan | Install-ModuleFast ``` -------------------------------- ### Single Line ModuleFast Installation with Specific Release Source: https://github.com/justingrote/modulefast/blob/main/README.MD Installs a specific version of a module using ModuleFast in a single command line. This allows pinning to a particular GitHub release, which is recommended for CI systems to ensure consistent builds. ```powershell & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -Release 'v0.2.0' -Specification ImportExcel ``` -------------------------------- ### Install Modules from Specification Files Source: https://context7.com/justingrote/modulefast/llms.txt Install dependencies defined in external files such as scripts with #Requires, module manifests, or JSON/PSD1 configuration files. ```powershell # Install from a script's #Requires statement Install-ModuleFast -Path './MyScript.ps1' -PassThru # Install from a module manifest's RequiredModules Install-ModuleFast -Path './MyModule.psd1' -WhatIf # Install from a .requires.psd1 file Install-ModuleFast -Path './ModuleFast.requires.psd1' -PassThru # Install from a .requires.json file Install-ModuleFast -Path './ModuleFast.requires.json' -PassThru ``` -------------------------------- ### View ModuleFast Help Source: https://github.com/justingrote/modulefast/blob/main/README.MD Loads ModuleFast and then displays detailed help information for the 'Install-ModuleFast' cmdlet. This is useful for understanding all available parameters and functionalities. ```powershell iwr bit.ly/modulefast | iex Get-Help Install-ModuleFast -Full ``` -------------------------------- ### Install Specific Modules with ModuleFast Source: https://github.com/justingrote/modulefast/blob/main/README.MD Installs specific modules using ModuleFast with version constraints defined using shorthand syntax. This allows for precise control over installed module versions. ```powershell Install-ModuleFast 'ImportExcel>7.1.0','Az.Resources','IPNetwork=0.1.0' ``` -------------------------------- ### Install Modules via CI/CD Pipeline Source: https://context7.com/justingrote/modulefast/llms.txt Execute ModuleFast directly in CI/CD pipelines like GitHub Actions using a single-line script block. This method installs specified modules without persistent installation, ensuring clean environments. ```powershell # Install modules in one line (module auto-unloads after) & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -Specification ImportExcel, Pester # Pin to a specific ModuleFast release for reproducibility & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -Release 'v0.2.0' -Specification ImportExcel # GitHub Actions example workflow step: # - name: Install PowerShell modules # shell: pwsh # run: | # & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -Release 'v0.2.0' -Specification @( # 'Pester>=5.0.0' # 'PSScriptAnalyzer' # 'ImportExcel=7.8.6' # ) ``` -------------------------------- ### Configure Custom NuGet Repositories Source: https://context7.com/justingrote/modulefast/llms.txt Install modules from private or custom NuGet v3 sources by specifying the -Source URL. Supports authentication via PSCredential objects. ```powershell # Use a custom repository Install-ModuleFast 'MyModule' -Source 'https://myrepo.example.com/index.json' -PassThru # With basic authentication (PAT tokens) $cred = Get-Credential Install-ModuleFast 'MyModule' -Source 'https://myrepo.example.com/index.json' -Credential $cred ``` -------------------------------- ### Single Line ModuleFast Installation Source: https://github.com/justingrote/modulefast/blob/main/README.MD Installs a module using ModuleFast in a single command line. This is ideal for CI/CD pipelines as it loads, installs, and automatically unloads the module upon completion. ```powershell & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -Specification ImportExcel ``` -------------------------------- ### Install PowerShell Modules with Install-ModuleFast Source: https://context7.com/justingrote/modulefast/llms.txt Install one or more modules using various versioning syntaxes and constraints. Supports parallel downloads and custom destination paths. ```powershell # Install a single module (latest version) Install-ModuleFast 'ImportExcel' -PassThru # Install multiple modules with version constraints Install-ModuleFast 'Pester>=5.0.0', 'Az.Accounts=2.13.2', 'PSScriptAnalyzer<2.0' -PassThru # Install with NuGet version range syntax Install-ModuleFast 'ImportExcel:(7.0.0, 7.8.0]' -PassThru # Install to a specific destination Install-ModuleFast 'ImportExcel' -Destination 'C:\Modules' -PassThru ``` -------------------------------- ### Run Latest Unstable Commit of ModuleFast Source: https://github.com/justingrote/modulefast/blob/main/README.MD This script downloads and executes the latest unstable main commit of ModuleFast. It configures the instance to use 'preview.pwsh.gallery' as the default repository, though this can be overridden. It supports all standard ModuleFast methods and parameters. ```powershell & ([scriptblock]::Create((iwr 'bit.ly/modulefastmain'))) -UseMain ``` -------------------------------- ### ModuleFast with AnyPackage Provider Source: https://github.com/justingrote/modulefast/blob/main/README.MD Demonstrates using ModuleFast as a provider for the AnyPackage unified package management interface. This allows cross-platform module management with shorthand specifications. ```powershell & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -Specification AnyPackage.ModuleFast Import-Module AnyPackage.ModuleFast AnyPackage\Install-Package -provider ModuleFast -Name 'ImportExcel<4','Pester<4' ``` -------------------------------- ### Load ModuleFast Session Source: https://github.com/justingrote/modulefast/blob/main/README.MD Loads the ModuleFast module into the current PowerShell session for immediate use. This method is bootstrappable and does not require prior installation of PowerShellGet. ```powershell iwr bit.ly/modulefast | iex Install-ModuleFast ImportExcel ``` -------------------------------- ### ModuleFast #requires Syntax Source: https://github.com/justingrote/modulefast/blob/main/README.MD Shows how to use the '#require' directive with ModuleFast to specify module dependencies. This syntax is compatible with PowerShell's built-in module requirement handling. ```powershell #require -module ImportExcel,Az.Resources.IPNetwork ``` -------------------------------- ### Clear HTTP Cache Source: https://context7.com/justingrote/modulefast/llms.txt Manually clear the in-memory HTTP cache to ensure subsequent installation commands fetch fresh metadata from remote repositories. ```powershell # Clear the cache when expecting new package versions Clear-ModuleFastCache # Then install with fresh data Install-ModuleFast 'MyModule' -PassThru ``` -------------------------------- ### CI/CD Reproducible Builds with Lockfiles Source: https://context7.com/justingrote/modulefast/llms.txt Generate and consume lockfiles to ensure consistent module versions across CI/CD environments using the -CI switch. ```powershell # First run: Install modules and generate lockfile Install-ModuleFast 'Pester', 'ImportExcel' -CI -PassThru # Subsequent runs: Install exact versions from lockfile Install-ModuleFast -CI # Custom lockfile path Install-ModuleFast 'Pester' -CI -CILockFilePath './dependencies.lock.json' ``` -------------------------------- ### Module Version Specification Syntax Source: https://context7.com/justingrote/modulefast/llms.txt ModuleFast supports NuGet-style versioning, including exact matches, ranges, and prerelease operators to control module dependencies precisely. ```powershell # Exact version match (=) Install-ModuleFast 'ImportExcel=7.8.6' # Greater than or equal (>=) Install-ModuleFast 'Az.Accounts>=2.13.0' # NuGet version range (:) Install-ModuleFast 'ImportExcel:(7.0.0, 7.8.0]' # > 7.0.0 and <= 7.8.0 # Prerelease operator (!) Install-ModuleFast 'ModuleName!>1.0.0' ``` -------------------------------- ### Bootstrap and Load ModuleFast Source: https://context7.com/justingrote/modulefast/llms.txt Load ModuleFast into your current PowerShell session using a one-liner bootstrap script. This method avoids dependencies on PowerShellGet. ```powershell # Bootstrap and load ModuleFast for the session iwr bit.ly/modulefast | iex # Verify the module is loaded Get-Module ModuleFast ``` -------------------------------- ### Update Modules and Force Remote Lookup Source: https://context7.com/justingrote/modulefast/llms.txt Use the -Update flag to force a check against remote repositories, bypassing local cache to ensure the latest versions are retrieved. ```powershell # Check for updates to installed modules Install-ModuleFast 'ImportExcel', 'Pester' -Update -WhatIf # Update and install newer versions Install-ModuleFast 'ImportExcel' -Update -PassThru ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.