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
ModuleFast introduces a shorthand string syntax for defining module specifications. It generally takes the form of `<ModuleName><Operator><Version>`. The version supports SemVer 2 and prerelease tags.
47
-
48
-
The available operators are:
49
-
-`=`: Exact version match. Examples: `ImportExcel=7.1.0`, `ImportExcel=7.1.0-preview`
50
-
-`>`: Greater than. Example: `ImportExcel>7.1.0`
51
-
-`>=`: Greater than or equal to. Example: `ImportExcel>=7.1.0`
52
-
-`<`: Less than. Example: `ImportExcel<7.1.0`
53
-
-`<=`: Less than or equal to. Example: `ImportExcel<=7.1.0`
54
-
-`!`: 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'
55
-
-`:`: Lets you specify a NuGet version range. Example: `ImportExcel:(7.0.0, 7.2.1-preview]`
56
-
57
-
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.
50
+
### Specify Specific Modules with Module Specification Syntax
58
51
59
-
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
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.
ModuleFast provides a [GitHub Action](https://github.com/marketplace/actions/modulefast). Details for usage are on the GitHub Marketplace page.
67
64
68
-
###AnyPackage
65
+
## AnyPackage
69
66
70
67
ModuleFast is supported with [AnyPackage](https://github.com/anypackage/anypackage), a cross-platform PowerShell unified package management interface. Shorthand specifications are supported. More information is available on the provider page.
You can specify a set of `ModuleSpecification` hashtables to Install-ModuleFast for explicit version constraints. For instance,
81
-
you can have only a very specific version to be installed, or only versions below a certain to be installed as well.
77
+
ModuleFast introduces a shorthand string syntax for defining module specifications. It generally takes the form of `<ModuleName><Operator><Version>`. The version supports SemVer 2 and prerelease tags.
-`=`: Exact version match. Examples: `ImportExcel=7.1.0`, `ImportExcel=7.1.0-preview`
81
+
-`>`: Greater than. Example: `ImportExcel>7.1.0`
82
+
-`>=`: Greater than or equal to. Example: `ImportExcel>=7.1.0`
83
+
-`<`: Less than. Example: `ImportExcel<7.1.0`
84
+
-`<=`: Less than or equal to. Example: `ImportExcel<=7.1.0`
85
+
-`!`: 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'
86
+
-`:`: Lets you specify a NuGet version range. Example: `ImportExcel:(7.0.0, 7.2.1-preview]`
87
+
88
+
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.
89
+
90
+
ModuleFast also fully supports the [ModuleSpecification object and hashtable-like string syntaxes](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7.5#-modules-module-name--hashtable) 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
91
+
92
+
## Logging
93
+
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.
94
+
95
+
## Dependency Resolution
96
+
97
+
This module uses a custom dependency resolution algorithm that selects the newest available modules that satisfy all the
98
+
dependency criteria. If a version of a locally installed module satisfies the "latest" criteria of the dependency graph,
99
+
it will be used rather than fetching what is newest on the gallery. This can be overriden with the `-Update` switch that
100
+
will recheck whats available in the remote.
87
101
88
102
### Requires Spec Installation
89
103
@@ -92,6 +106,7 @@ ModuleFast can read a variety of files for module specifications:
92
106
1. .ps1 PowerShell Scripts with #Requires comment
93
107
1. .psm1 PowerShell Modules with #Requires comment
94
108
1. .psd1 Module Manifest with a RequiredModules property
109
+
1. .psd1 File in [PSDepend](https://github.com/RamblingCookieMonster/PSDepend) format
95
110
1. .psd1 file with module/version pairs
96
111
1. .json file with module/version pairs
97
112
1. .json file with array of Module Specification strings
@@ -136,11 +151,11 @@ PSGetv3 is compatibility, the focus with ModuleFast is speed of installation/upd
136
151
1. Takes your module specifications and builds a declarative dependency tree, following a IaC plan/apply approach to installing modules. By default it will evaluate locally installed modules in all of your configured PSModulePath to determine if an already-installed module meets the criteria.
137
152
1. Uses a custom HTTPClient and async tasks to build the dependency tree quickly, querying with minimal data possible and using batch queries where possible to optimize for performance. This is all done in native PowerShell, no C# required (though C# would allow for certain operations to be even more parallelizable by chaining tasks).
138
153
1. Uses HTTP/2 to run all queries in a single TCP conversation where possible (PSGallery supports it)
139
-
1.For PowerShell Gallery, uses an optimized [CloudFlare Worker](https://github.com/justingrote/pwshgallery) to resolve dependencies as fast as possible.
154
+
1.A custom nuget v3 mirror of PowerShell Gallery called pwsh.gallery uses Sleet to mirror all PowerShell Gallery packages and is fronted by Cloudflare for high performance, high availability, and data locality.
140
155
141
156
## What this script is not
142
157
143
-
This is an example of how fast things *can* be, with certain assumptions. It is *not* a replacement for
158
+
ModuleFast is an implementation focusing on of how fast things *can* be, with certain assumptions. It is *not* a replacement for
144
159
PowerShellGet, which has much broader support for multiple repos, authentication, etc.
145
160
146
161
It makes a lot of very bad assumptions, most of which are safe for PowerShell Gallery at least
@@ -160,21 +175,14 @@ It makes a lot of very bad assumptions, most of which are safe for PowerShell Ga
160
175
1. Initially the logic would fetch the main page and resolve dependencies by fetching individual versions. Turns out its only barely slower to return all versions of a module in single call, probably because the PSGallery server-side filtering doesnt cache, so we instead fetch all versions of a module in a reduced way from our Cloudflare worker and use that as a cache.
161
176
1. Parallel dependency lookups (lots of Az dependencies require Az.Account) resulted in lots of duplicate calls for Az.Account. Since all task calls bottleneck through our main async loop logic, we can safely inspect existing dependency calls just before execution to determine if the existing call will satisfy it, and then add the context on to the existing object to prevent the duplicate calls.
162
177
163
-
## Dependency Resolution
178
+
#Development
164
179
165
-
This module uses a custom dependency resolution algorithm that selects the newest available modules that satisfy all the
166
-
dependency criteria. If a version of a locally installed module satisfies the "latest" criteria of the dependency graph,
167
-
it will be used rather than fetching what is newest on the gallery. This can be overriden with the `-Update` switch that
168
-
will recheck whats available in the remote.
180
+
Run `.\build.ps1` which will install all prerequisites (using ModuleFast!) and compile/test the package. After running it once, you can simply use `Invoke-Build` to start a new build. The module will be output into the `Build` Directory by default.
169
181
170
-
###Testing Latest Commit
182
+
## Testing Latest Commit
171
183
172
184
This script will use the latest unstable main commit and configure the instance of Modulefast to use `preview.pwsh.gallery` as the default repository (you can still override this with the Source parameter). It supports all the same methods and parameters as normal ModuleFast.
Run `.\build.ps1` which will install all prerequisites (using ModuleFast!) and compile/test the package. After running it once, you can simply use `Invoke-Build` to start a new build. The module will be output into the `Build` Directory by default.
0 commit comments