JustinGrote / ModuleFast

A "fast and loose" way to install modules from Powershell Gallery quickly. Meant for CICD, not production
Other
74 stars 5 forks source link

Missing parameter DestinationOnly in full release 0.1.0 #53

Closed johlju closed 6 months ago

johlju commented 6 months ago

I can't get the parameter DestinationOnly to work when using v0.1.0. Shows missing in the syntax below.

PS> iwr bit.ly/modulefast | iex                                                                                                         
PS> get-help Install-ModuleFast -Parameter DestinationOnly
Get-Help: No parameter matches criteria DestinationOnly.
PS> get-help Install-ModuleFast                           

NAME
    Install-ModuleFast

SYNOPSIS
    High performance, declarative Powershell Module Installer

SYNTAX
    Install-ModuleFast [[-Specification] <ModuleFastSpec[]>] [-Destination <String>] [-Source <String>] [-Credential 
    <PSCredential>] [-NoPSModulePathUpdate] [-NoProfileUpdate] [-Update] [-Prerelease] [-CI] [-ThrottleLimit <Int32>] 
    [-CILockFilePath <String>] [-Plan] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-ModuleFast -Path <String> [-Destination <String>] [-Source <String>] [-Credential <PSCredential>] 
    [-NoPSModulePathUpdate] [-NoProfileUpdate] [-Update] [-Prerelease] [-CI] [-ThrottleLimit <Int32>] [-CILockFilePath <String>] 
    [-Plan] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

    Install-ModuleFast [-Destination <String>] [-Source <String>] [-Credential <PSCredential>] [-NoPSModulePathUpdate] 
    [-NoProfileUpdate] [-Update] [-Prerelease] [-CI] [-ThrottleLimit <Int32>] [-CILockFilePath <String>] -ModuleFastInfo 
    <ModuleFastInfo[]> [-Plan] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION
    ModuleFast is a high performance, declarative PowerShell module installer. It is optimized for speed and written primarily 
    in PowerShell and can be bootstrapped in a single line of code. It is ideal for Continuous Integration/Deployment and 
    serverless scenarios where you want to install modules quickly and without any user interaction. It is inspired by pnpm and 
    other high performance declarative package managers.

    ModuleFast accepts a variety of familiar PowerShell syntaxes and objects for module specification as well as a custom 
    shorthand syntax allowing complex version requirements to be defined in a single string.

    ModuleFast can also install the required modules specified in the #Requires line of a script, or in the RequiredModules 
    section of a module manifest, by simplying providing the path to that file in the -Path parameter (which also accepts remote 
    UNC, http, and https URLs).

    ---------------------------
    Module Specification Syntax
    ---------------------------
    ModuleFast supports a shorthand string syntax for defining module specifications. It generally takes the form of 
    '<Module><Operator><Version>'. The version supports SemVer 2 and prerelease tags.

    The available operators are:
    - '=': Exact version match. Examples: 'ImportExcel=7.1.0', 'ImportExcel=7.1.0-preview'
    - '>': Greater than. Example: 'ImportExcel>7.1.0'
    - '>=': Greater than or equal to. Example: 'ImportExcel>=7.1.0'
    - '<': Less than. Example: 'ImportExcel<7.1.0'
    - '<=': Less than or equal to. Example: 'ImportExcel<=7.1.0'
    - ':': Lets you specify a NuGet version range. Example: 'ImportExcel:(7.0.0, 7.2.1-preview]' For more info: 
    https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges. Wilcards are supported with this syntax 
    e.g. 'ImportExcel:3.2.*' will install the latest 3.2.x version.

    ModuleFast also fully supports the ModuleSpecification object and hashtable-like string syntaxes that are used by 
    Install-Module and Install-PSResource. More information on this format: 
    https://learn.microsoft.com/en-us/dotnet/api/microsoft.powershell.commands.modulespecification?view=powershellsdk-7.4.0

    -------
    Logging
    -------
    Modulefast has extensive Verbose and Debug information available if you specify the -Verbose and/or -Debug parameters. This 
    can be useful for troubleshooting or understanding how ModuleFast is working. Verbose level provides a high level "what" 
    view of the process of module selection, while Debug level provides a much more detailed "Why" information about the module 
    selection and installation process that can be useful in troubleshooting issues.

    -----------------
    Installation Path
    -----------------
    ModuleFast will install modules to the default PowerShell module path on non-Windows platforms. On Windows, it will install 
    to %LOCALAPPDATA%\PowerShell\Modules by default as the default Documents PowerShell Modules folder has increasing caused 
    problems due to conflicts with document syncing programs such as OneDrive. You can override this behavior by specifying the 
    -Destination parameter. You can also specify 'CurrentUser' to install to the legacy Documents PowerShell Modules folder on 
    Windows only.

    As part of this installation process on Windows, ModuleFast will add the destination to your PSModulePath for the current 
    session. This is done to ensure that the modules are available for use in the current session. If you do not want this 
    behavior, you can specify the -NoPSModulePathUpdate switch.

    In addition, if you do not already have the %LOCALAPPDATA%\PowerShell\Modules in your $env:PSModulesPath, Modulefast will 
    append a command to add it to your user profile. This is done to ensure that the modules are available for use in future 
    sessions. If you do not want this behavior, you can specify the -NoProfileUpdate switch.

    -------
    Caching
    -------
    ModuleFast will cache the results of the module selection process in memory for the duration of the PowerShell session. This 
    is done to improve performance when multiple modules are being installed. If you want to clear the cache, you can call 
    Clear-ModuleFastCache.

RELATED LINKS

REMARKS
    To see the examples, type: "Get-Help Install-ModuleFast -Examples"
    For more information, type: "Get-Help Install-ModuleFast -Detailed"
    For technical information, type: "Get-Help Install-ModuleFast -Full"
johlju commented 6 months ago

If I use the "bleeding edge" version (from main branch) it works.

PS> & ([scriptblock]::Create((iwr 'bit.ly/modulefast'))) -UseMain    
PS> get-help Install-ModuleFast -Parameter DestinationOnly                                            

-DestinationOnly [<SwitchParameter>]
    Only consider the specified destination and not any other paths currently in the PSModulePath. This is useful for CI 
    scenarios where you want to ensure that the modules are installed in a specific location.

    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false
JustinGrote commented 6 months ago

Weird, let me look into it

johlju commented 6 months ago

Looks like the release assets are not correct files.

JustinGrote commented 6 months ago

@johlju yup, just noticed that, it's fixed now.