- Windows PowerShell 5.1 with .NET Framework 4.7.2+ or
- PowerShell Core 6.2 or greater on Windows, MacOS and Linux or
- PowerShell 7.0 or greater on Windows, MacOS and Linux
For a list of platforms that PowerShell 7.0 is supported on see.
The following modules are required for PSRule.Rules.GitHub
to work:
- PSRule
The required version of each module will automatically be installed along-side PSRule.Rules.GitHub
when using Install-Module
or Update-Module
cmdlets.
Install from PowerShell Gallery for all users (requires permissions):
# Install module
Install-Module -Name 'PSRule.Rules.GitHub' -Repository PSGallery;
Install from PowerShell Gallery for current user only:
# Install module
Install-Module -Name 'PSRule.Rules.GitHub' -Repository PSGallery -Scope CurrentUser;
Save for offline use from PowerShell Gallery:
# Save module, in the .\modules directory
Save-Module -Name 'PSRule', 'PSRule.Rules.GitHub' -Path '.\modules';
For pre-release versions the
-AllowPrerelease
switch must be added when callingInstall-Module
orSave-Module
.To install pre-release module versions, upgrading to the latest version of PowerShellGet may be required. To do this use:
Install-Module -Name PowerShellGet -Repository PSGallery -Scope CurrentUser -Force
To build this module from source run ./build.ps1
.
This build script will compile the module and documentation then output the result into out/modules/PSRule.Rules.GitHub
.
The following PowerShell modules will be automatically downloaded if the required versions are not present:
- PlatyPS
- Pester
- PSScriptAnalyzer
- PowerShellGet
- PackageManagement
- InvokeBuild
These additional modules are only required for building PSRule and are not required for running PSRule.
If you are on a network that does not permit Internet access to the PowerShell Gallery, download these modules on an alternative device that has access. The following script can be used to download the required modules to an alternative device. After downloading the modules copy the module directories to devices with restricted Internet access.
# Save modules, in the .\modules directory
Save-Module -Name PlatyPS, Pester, PSScriptAnalyzer, PowerShellGet, PackageManagement, InvokeBuild -Repository PSGallery -Path '.\modules';
Additionally .NET Core SDK v3.1 is required. .NET Core will not be automatically downloaded and installed. To download and install the latest SDK see Download .NET Core 3.1.