Skip to content

Commit 1c2591b

Browse files
committed
✨Additional ModuleFast Requires Check
1 parent 8ccbbcc commit 1c2591b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ModuleFast.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using namespace System.IO.Compression
44
using namespace System.Reflection
55

66
#requires -version 7.2
7+
78
# This is the bootstrap script for Modules
89
[CmdletBinding(PositionalBinding = $false)]
910
param (
@@ -34,8 +35,15 @@ param (
3435
[Parameter(DontShow)]
3536
[switch]$UseMain
3637
)
38+
3739
$ErrorActionPreference = 'Stop'
3840

41+
#Bootstrap via IEX does not evaluate requires so we need an additional check here:
42+
if ($PSVersionTable.PSVersion -lt '7.2.0') {
43+
throw [NotSupportedException]'The ModuleFast Bootstrap script requires PowerShell 7.2 or higher. Specific ModuleFast versions may have more strict requirements.'
44+
}
45+
46+
3947

4048
#We need to load the versioning assembly before we load the dependent classes
4149
#We inline this in order to keep ModuleFast self-contained

0 commit comments

Comments
 (0)