Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
Add UseBasicParsing to support docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolm committed Aug 20, 2019
1 parent 2629d7f commit 00df176
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file modified src/power-nvm.psd1
Binary file not shown.
6 changes: 3 additions & 3 deletions src/power-nvm.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function Get-NodeVersions(
[ValidatePattern('^v?\d{1,2}([.]\d+){0,2}$')]
$Filter
) {
$versions = Invoke-WebRequest -Uri https://nodejs.org/dist/index.json | ConvertFrom-Json
$versions = Invoke-WebRequest -UseBasicParsing -Uri https://nodejs.org/dist/index.json | ConvertFrom-Json
$versions | Where-Object { $_.version.Contains($Filter) } | Select-Object -Property version,npm,date
}

Expand Down Expand Up @@ -197,7 +197,7 @@ function Install-Node(
) {
$global:progressPreference = 'silentlyContinue';
Write-Host "Retrieving versions...";
$versions = Invoke-WebRequest -Uri https://nodejs.org/dist/index.json | ConvertFrom-Json;
$versions = Invoke-WebRequest -UseBasicParsing -Uri https://nodejs.org/dist/index.json | ConvertFrom-Json;
$global:progressPreference = 'Continue';

if ($Version -eq "latest") {
Expand Down Expand Up @@ -228,7 +228,7 @@ function Install-Node(
$downloadUrl = "https://nodejs.org/dist/$versionToInstall/node-$versionToInstall-win-$versionTag.zip";

$dest = (Join-Path $env:TEMP "node-${versionToInstall}.zip");
Invoke-WebRequest $downloadUrl -OutFile $dest;
Invoke-WebRequest -UseBasicParsing $downloadUrl -OutFile $dest;

try {
7z x $dest -o"$versionsDir" -r -aoa
Expand Down

0 comments on commit 00df176

Please sign in to comment.