diff --git a/install.ps1 b/install.ps1 index c099224..5ba8af5 100644 --- a/install.ps1 +++ b/install.ps1 @@ -51,7 +51,11 @@ if (!$Version) { if ($PSVersionTable.PSVersion.Major -lt 6) { $Response = Invoke-WebRequest 'https://github.com/denoland/deno/releases' $HTMLFile = New-Object -Com HTMLFile - $HTMLFile.IHTMLDocument2_write($Response.Content) + if ($HTMLFile.IHTMLDocument2_write) { + $HTMLFile.IHTMLDocument2_write($Response.Content) + } else { + $HTMLFile.write([System.Text.Encoding]::Unicode.GetBytes($Response.Content)) + } $DenoUri = $HTMLFile.getElementsByTagName('a') | Where-Object { $_.href -like "about:/denoland/deno/releases/download/*/deno_${OS}_x64.$Zip" } | ForEach-Object { $_.href -replace 'about:', 'https://github.com' } |