diff --git a/bin/getzig.cmd b/bin/getzig.cmd index 5584fa66..89d57af9 100644 --- a/bin/getzig.cmd +++ b/bin/getzig.cmd @@ -833,6 +833,10 @@ if ($matches.count) { # +#launch example +#powershell -Command "Invoke-WebRequest -Uri 'https://www.gitea1.intx.com.au/jn/punkshell/raw/branch/master/bin/getzig.cmd' -OutFile 'getzig.cmd'; Start-Process 'cmd.exe' -ArgumentList @('/c', 'getzig.cmd') -NoNewWindow -Wait" +#powershell -Command "Invoke-WebRequest -Uri 'https://www.gitea1.intx.com.au/jn/punkshell/raw/branch/master/bin/getzig.cmd' -OutFile 'getzig.cmd'; Start-Process 'getzig.cmd' -NoNewWindow -Wait" + #Join-Path using verbose method to support powershell 5? #$outbase = Join-Path -Path $PSScriptRoot -ChildPath "../.." $outbase = $PSScriptRoot @@ -892,20 +896,26 @@ if (Get-Command "minisign" -ErrorAction SilentlyContinue) { Write-Host "Installing minisign version: ${wingetversion}" Install-WinGetPackage -Id "jedisct1.minisign" } + if ($PSVersionTable.PSEdition -eq "Desktop") { + Invoke-Command {& "powershell.exe" } -NoNewScope + } else { + Invoke-Command {& "pwsh.exe" } -NoNewScope + } if (Get-Command "minisign" -ErrorAction SilentlyContinue) { Write-Host "minisign is now available" } else { Write-Host "minisign is still not available" + exit } - - exit } $zigpubkey = "RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U" $mirrors_url = "https://ziglang.org/download/community-mirrors.txt" $mirrors_response = $(Invoke-WebRequest -Uri $mirrors_url) if ($mirrors_response.StatusCode -eq 200) { - $mirror_array = $mirrors_response.Content.TrimEnd("`r`n") -split "`r`n|`n" + #https://www.gitea1.intx.com.au/jn/punkbin/raw/branch/master/win64/tools/zig-x86_64-windows-0.15.1.zip + $mirror_array = "https://gitea1.intx.com.au/jn/punkbin/raw/branch/master/win64/tools" + $mirror_array += $mirrors_response.Content.TrimEnd("`r`n") -split "`r`n|`n" #$mirror_array += "https://bogusxxx.org" #test behaviour of a bogus/down entry $mirror_array += "https://ziglang.org" #main site diff --git a/src/scriptapps/getzig.ps1 b/src/scriptapps/getzig.ps1 index 923f9751..cf1dcfdf 100644 --- a/src/scriptapps/getzig.ps1 +++ b/src/scriptapps/getzig.ps1 @@ -1,4 +1,8 @@ +#launch example +#powershell -Command "Invoke-WebRequest -Uri 'https://www.gitea1.intx.com.au/jn/punkshell/raw/branch/master/bin/getzig.cmd' -OutFile 'getzig.cmd'; Start-Process 'cmd.exe' -ArgumentList @('/c', 'getzig.cmd') -NoNewWindow -Wait" +#powershell -Command "Invoke-WebRequest -Uri 'https://www.gitea1.intx.com.au/jn/punkshell/raw/branch/master/bin/getzig.cmd' -OutFile 'getzig.cmd'; Start-Process 'getzig.cmd' -NoNewWindow -Wait" + #Join-Path using verbose method to support powershell 5? #$outbase = Join-Path -Path $PSScriptRoot -ChildPath "../.." $outbase = $PSScriptRoot @@ -58,20 +62,26 @@ if (Get-Command "minisign" -ErrorAction SilentlyContinue) { Write-Host "Installing minisign version: ${wingetversion}" Install-WinGetPackage -Id "jedisct1.minisign" } + if ($PSVersionTable.PSEdition -eq "Desktop") { + Invoke-Command {& "powershell.exe" } -NoNewScope + } else { + Invoke-Command {& "pwsh.exe" } -NoNewScope + } if (Get-Command "minisign" -ErrorAction SilentlyContinue) { Write-Host "minisign is now available" } else { Write-Host "minisign is still not available" + exit } - - exit } $zigpubkey = "RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U" $mirrors_url = "https://ziglang.org/download/community-mirrors.txt" $mirrors_response = $(Invoke-WebRequest -Uri $mirrors_url) if ($mirrors_response.StatusCode -eq 200) { - $mirror_array = $mirrors_response.Content.TrimEnd("`r`n") -split "`r`n|`n" + #https://www.gitea1.intx.com.au/jn/punkbin/raw/branch/master/win64/tools/zig-x86_64-windows-0.15.1.zip + $mirror_array = "https://gitea1.intx.com.au/jn/punkbin/raw/branch/master/win64/tools" + $mirror_array += $mirrors_response.Content.TrimEnd("`r`n") -split "`r`n|`n" #$mirror_array += "https://bogusxxx.org" #test behaviour of a bogus/down entry $mirror_array += "https://ziglang.org" #main site