mirror of
https://github.com/danbulant/deno_install
synced 2026-06-18 05:51:32 +00:00
fix IHTMLDocument2_write not exist (#36)
This commit is contained in:
parent
e8a3ed1159
commit
36289b3be7
1 changed files with 5 additions and 1 deletions
|
|
@ -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' } |
|
||||
|
|
|
|||
Loading…
Reference in a new issue