You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Help Improvements
Fixes#47
* Add link for pnpm
* Update Prerelease Info
* Add note about Update clearing ModuleFastCache
* More Fixes
* Clarify the double statement in CI example
Copy file name to clipboardExpand all lines: ModuleFast.psm1
+14-10Lines changed: 14 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ function Install-ModuleFast {
33
33
.SYNOPSIS
34
34
High performance, declarative Powershell Module Installer
35
35
.DESCRIPTION
36
-
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.
36
+
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 (https://pnpm.io/) and other high performance declarative package managers.
37
37
38
38
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.
39
39
@@ -50,7 +50,10 @@ function Install-ModuleFast {
50
50
- '>=': Greater than or equal to. Example: 'ImportExcel>=7.1.0'
51
51
- '<': Less than. Example: 'ImportExcel<7.1.0'
52
52
- '<=': Less than or equal to. Example: 'ImportExcel<=7.1.0'
53
-
- ':': 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.
53
+
- '!': A prerelease operator that can be present at the beginning or end of a module name to indicate that prerelease versions are acceptable. Example: 'ImportExcel!', '!ImportExcel'. It can be combined with the other operators like so: 'ImportExcel!>7.1.0'
54
+
- ':': Lets you specify a NuGet version range. Example: 'ImportExcel:(7.0.0, 7.2.1-preview]'
55
+
56
+
For more information about NuGet version range syntax used with the ':' operator: 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.
54
57
55
58
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
56
59
@@ -74,7 +77,7 @@ function Install-ModuleFast {
74
77
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.
75
78
76
79
.PARAMETERWhatIf
77
-
If specified, will output the installation plan to the pipeline as well as the console. This can be saved and provided to Install-ModuleFast at a later date.
80
+
Outputs the installation plan of modules not already available and needing to be installed to the pipeline as well as the console. This can be saved and provided to Install-ModuleFast at a later date.
78
81
79
82
.EXAMPLE
80
83
Install-ModuleFast 'ImportExcel' -PassThru
@@ -179,8 +182,8 @@ function Install-ModuleFast {
179
182
VMware.PowerCLI.Sdk.Types 12.6.0.19600125
180
183
181
184
.EXAMPLE
182
-
Install-ModuleFast 'ImportExcel' -CI
183
-
Install-ModuleFast -CI
185
+
Install-ModuleFast 'ImportExcel' -CI #This will write a lockfile to the current directory
186
+
Install-ModuleFast -CI #This will use the previously created lockfile to install same state as above.
184
187
185
188
If the -CI switch is specified, ModuleFast will write a lockfile to the current directory indicating all modules that were installed. This lockfile will contain the exact versions of the modules that were installed. If the lockfile is present in the future, ModuleFast will only install the versions specified in the lockfile, which is useful for reproducing CI builds even if newer versions of modules are releases that match the initial specification.
186
189
@@ -210,20 +213,21 @@ function Install-ModuleFast {
210
213
[Switch]$NoPSModulePathUpdate,
211
214
#Setting this won't add the default destination to your powershell.config.json. This really only matters on Windows.
212
215
[Switch]$NoProfileUpdate,
213
-
#Setting this will check for newer modules if your installed modules are not already at the upper bound of the required version range.
216
+
#Setting this will check for newer modules if your installed modules are not already at the upper bound of the required version range. Note that specifying this will also clear the local request cache for remote repositories which will result in slower evaluations if the information has not changed.
214
217
[Switch]$Update,
215
-
#Consider prerelease packages in the evaluation. Note that if a non-prerelease package has a prerelease dependency, that dependency will be included regardless of this setting.
218
+
#Prerelease packages will be included in ModuleFast evaluation. If a non-prerelease package has a prerelease dependency, that dependency will be included regardless of this setting. If this setting is specified, all packages will be evaluated for prereleases regardless of if they have a prerelease indicator such as '!' in their specification name, but will still be subject to specification version constraints that would prevent a prerelease from installing.
216
219
[Switch]$Prerelease,
217
220
#Using the CI switch will write a lockfile to the current folder. If this file is present and -CI is specified in the future, ModuleFast will only install the versions specified in the lockfile, which is useful for reproducing CI builds even if newer versions of software come out.
218
221
[Switch]$CI,
219
222
#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.
220
223
[Switch]$DestinationOnly,
221
224
#How many concurrent installation threads to run. Each installation thread, given sufficient bandwidth, will likely saturate a full CPU core with decompression work. This defaults to the number of logical cores on the system. If your system uses HyperThreading and presents more logical cores than physical cores available, you may want to set this to half your number of logical cores for best performance.
#The path to the lockfile. By default it is requires.lock.json in the current folder. This is ignored if CI is not present. It is generally not recommended to change this setting.
226
+
#The path to the lockfile. By default it is requires.lock.json in the current folder. This is ignored if -CI parameter is not present. It is generally not recommended to change this setting.
#A list of ModuleFastInfo objects to install. This parameterset is used when passing a plan to ModuleFast via the pipeline and is generally not used directly.
#Output a list of specifications for the modules to install. This is the same as -WhatIf but without the additional WhatIf Output
230
+
#Outputs the installation plan of modules not already available and needing to be installed to the pipeline as well as the console. This can be saved and provided to Install-ModuleFast at a later date. This is functionally the same as -WhatIf but without the additional WhatIf Output
227
231
[Switch]$Plan,
228
232
#This will output the resulting modules that were installed.
229
233
[Switch]$PassThru
@@ -559,7 +563,7 @@ function Get-ModuleFastPlan {
559
563
}
560
564
561
565
if ($currentModuleSpec.Guid-ne [Guid]::Empty) {
562
-
Write-Warning"${currentModuleSpec}: A GUID constraint was found in the module spec. ModuleSpec will currently only verify GUIDs after the module has been installed, so a plan may not be accurate. It is not recommended to match modules by GUID in ModuleFast."
566
+
Write-Warning"${currentModuleSpec}: A GUID constraint was found in the module spec. ModuleSpec will currently only verify GUIDs after the module has been installed, so a plan may not be accurate. It is not recommended to match modules by GUID in ModuleFast, but instead verify package signatures for full package authenticity."
0 commit comments