@@ -7,27 +7,27 @@ using namespace System.Reflection
7
7
# This is the bootstrap script for Modules
8
8
[CmdletBinding (PositionalBinding = $false )]
9
9
param (
10
- # Specify a specific release to use, otherwise 'latest' is used
11
- [string ]$Release = ' latest' ,
12
- # Specify the user
13
- [string ]$User = ' JustinGrote' ,
14
- # Specify the repo
15
- [string ]$Repo = ' ModuleFast' ,
16
- # Specify the module file
17
- [string ]$ModuleFile = ' ModuleFast.psm1' ,
18
- # Entrypoint to be used if additional args are specified
19
- [string ]$EntryPoint = ' Install-ModuleFast' ,
20
- # Specify the module name
21
- [string ]$ModuleName = ' ModuleFast' ,
22
- # Path of the module to bootstrap. You normally won't change this but you can override it if you want
23
- [string ]$Uri = $ (
24
- $base = " https://github.com/$User /$Repo /releases/{0}/$ModuleFile " ;
25
- $version = $Release -eq ' latest' ? ' latest/download' : " download/$Release " ;
26
- $base -f $version
27
- ),
28
- # All additional arguments passed to this script will be passed to Install-ModuleFast
29
- [Parameter (ValueFromRemainingArguments )]$installArgs ,
30
- # Used for testing
10
+ # Specify a specific release to use, otherwise 'latest' is used
11
+ [string ]$Release = ' latest' ,
12
+ # Specify the user
13
+ [string ]$User = ' JustinGrote' ,
14
+ # Specify the repo
15
+ [string ]$Repo = ' ModuleFast' ,
16
+ # Specify the module file
17
+ [string ]$ModuleFile = ' ModuleFast.psm1' ,
18
+ # Entrypoint to be used if additional args are specified
19
+ [string ]$EntryPoint = ' Install-ModuleFast' ,
20
+ # Specify the module name
21
+ [string ]$ModuleName = ' ModuleFast' ,
22
+ # Path of the module to bootstrap. You normally won't change this but you can override it if you want
23
+ [string ]$Uri = $ (
24
+ $base = " https://github.com/$User /$Repo /releases/{0}/$ModuleFile " ;
25
+ $version = $Release -eq ' latest' ? ' latest/download' : " download/$Release " ;
26
+ $base -f $version
27
+ ),
28
+ # All additional arguments passed to this script will be passed to Install-ModuleFast
29
+ [Parameter (ValueFromRemainingArguments )]$installArgs ,
30
+ # Used for testing
31
31
[Parameter (DontShow)]
32
32
[switch ]$ImportNugetVersioning ,
33
33
# Used for testing
@@ -75,7 +75,7 @@ if ($UseMain) {
75
75
Write-Debug " Fetching $ModuleName from $Uri "
76
76
$ProgressPreference = ' SilentlyContinue'
77
77
try {
78
- $response = ( Invoke-WebRequest $uri ).Content
78
+ $response = [ HttpClient ]::new().GetStringAsync( $Uri ).GetAwaiter().GetResult()
79
79
} catch {
80
80
$PSItem.ErrorDetails = " Failed to fetch $ModuleName from $Uri `: $PSItem "
81
81
$PSCmdlet.ThrowTerminatingError ($PSItem )
0 commit comments