Skip to content

Commit dc9ff7e

Browse files
committed
[main] Update AL-Go System Files from microsoft/AL-Go-PTE@preview - becb26e1f895fb75145bbc10535afb19c09bff5c
1 parent 2a4e4b6 commit dc9ff7e

21 files changed

+816
-362
lines changed

.AL-Go/cloudDevEnv.ps1

+24-13
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,27 @@
66
Param(
77
[string] $environmentName = "",
88
[bool] $reuseExistingEnvironment,
9-
[switch] $fromVSCode
9+
[switch] $fromVSCode,
10+
[switch] $clean
1011
)
1112

1213
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
1314

15+
function DownloadHelperFile {
16+
param(
17+
[string] $url,
18+
[string] $folder
19+
)
20+
21+
$prevProgressPreference = $ProgressPreference; $ProgressPreference = 'SilentlyContinue'
22+
$name = [System.IO.Path]::GetFileName($url)
23+
Write-Host "Downloading $name from $url"
24+
$path = Join-Path $folder $name
25+
Invoke-WebRequest -UseBasicParsing -uri $url -OutFile $path
26+
$ProgressPreference = $prevProgressPreference
27+
return $path
28+
}
29+
1430
try {
1531
Clear-Host
1632
Write-Host
@@ -24,17 +40,11 @@ Write-Host -ForegroundColor Yellow @'
2440
2541
'@
2642

27-
$webClient = New-Object System.Net.WebClient
28-
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
29-
$webClient.Encoding = [System.Text.Encoding]::UTF8
30-
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/Github-Helper.psm1'
31-
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
32-
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
33-
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
34-
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1'
35-
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
36-
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
37-
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)
43+
$tmpFolder = Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::NewGuid().ToString())"
44+
New-Item -Path $tmpFolder -ItemType Directory -Force | Out-Null
45+
$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/c198d5ffe9434dda2087ec2c5a9edc61e5118f28/Actions/Github-Helper.psm1' -folder $tmpFolder
46+
$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/c198d5ffe9434dda2087ec2c5a9edc61e5118f28/Actions/AL-Go-Helper.ps1' -folder $tmpFolder
47+
DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/c198d5ffe9434dda2087ec2c5a9edc61e5118f28/Actions/Packages.json' -folder $tmpFolder | Out-Null
3848

3949
Import-Module $GitHubHelperPath
4050
. $ALGoHelperPath -local
@@ -78,7 +88,8 @@ CreateDevEnv `
7888
-environmentName $environmentName `
7989
-reuseExistingEnvironment:$reuseExistingEnvironment `
8090
-baseFolder $baseFolder `
81-
-project $project
91+
-project $project `
92+
-clean:$clean
8293
}
8394
catch {
8495
Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)"

.AL-Go/localDevEnv.ps1

+25-13
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,32 @@
55
#
66
Param(
77
[string] $containerName = "",
8+
[ValidateSet("UserPassword", "Windows")]
89
[string] $auth = "",
910
[pscredential] $credential = $null,
1011
[string] $licenseFileUrl = "",
1112
[switch] $fromVSCode,
12-
[switch] $accept_insiderEula
13+
[switch] $accept_insiderEula,
14+
[switch] $clean
1315
)
1416

1517
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
1618

19+
function DownloadHelperFile {
20+
param(
21+
[string] $url,
22+
[string] $folder
23+
)
24+
25+
$prevProgressPreference = $ProgressPreference; $ProgressPreference = 'SilentlyContinue'
26+
$name = [System.IO.Path]::GetFileName($url)
27+
Write-Host "Downloading $name from $url"
28+
$path = Join-Path $folder $name
29+
Invoke-WebRequest -UseBasicParsing -uri $url -OutFile $path
30+
$ProgressPreference = $prevProgressPreference
31+
return $path
32+
}
33+
1734
try {
1835
Clear-Host
1936
Write-Host
@@ -27,17 +44,11 @@ Write-Host -ForegroundColor Yellow @'
2744
2845
'@
2946

30-
$webClient = New-Object System.Net.WebClient
31-
$webClient.CachePolicy = New-Object System.Net.Cache.RequestCachePolicy -argumentList ([System.Net.Cache.RequestCacheLevel]::NoCacheNoStore)
32-
$webClient.Encoding = [System.Text.Encoding]::UTF8
33-
$GitHubHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/Github-Helper.psm1'
34-
Write-Host "Downloading GitHub Helper module from $GitHubHelperUrl"
35-
$GitHubHelperPath = "$([System.IO.Path]::GetTempFileName()).psm1"
36-
$webClient.DownloadFile($GitHubHelperUrl, $GitHubHelperPath)
37-
$ALGoHelperUrl = 'https://raw.githubusercontent.com/freddydk/AL-Go/nuget/Actions/AL-Go-Helper.ps1'
38-
Write-Host "Downloading AL-Go Helper script from $ALGoHelperUrl"
39-
$ALGoHelperPath = "$([System.IO.Path]::GetTempFileName()).ps1"
40-
$webClient.DownloadFile($ALGoHelperUrl, $ALGoHelperPath)
47+
$tmpFolder = Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::NewGuid().ToString())"
48+
New-Item -Path $tmpFolder -ItemType Directory -Force | Out-Null
49+
$GitHubHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/c198d5ffe9434dda2087ec2c5a9edc61e5118f28/Actions/Github-Helper.psm1' -folder $tmpFolder
50+
$ALGoHelperPath = DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/c198d5ffe9434dda2087ec2c5a9edc61e5118f28/Actions/AL-Go-Helper.ps1' -folder $tmpFolder
51+
DownloadHelperFile -url 'https://raw.githubusercontent.com/microsoft/AL-Go/c198d5ffe9434dda2087ec2c5a9edc61e5118f28/Actions/Packages.json' -folder $tmpFolder | Out-Null
4152

4253
Import-Module $GitHubHelperPath
4354
. $ALGoHelperPath -local
@@ -134,7 +145,8 @@ CreateDevEnv `
134145
-auth $auth `
135146
-credential $credential `
136147
-licenseFileUrl $licenseFileUrl `
137-
-accept_insiderEula:$accept_insiderEula
148+
-accept_insiderEula:$accept_insiderEula `
149+
-clean:$clean
138150
}
139151
catch {
140152
Write-Host -ForegroundColor Red "Error: $($_.Exception.Message)`nStacktrace: $($_.scriptStackTrace)"

.github/AL-Go-Settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "PTE",
3-
"templateUrl": "https://github.com/freddydk/AL-Go@nuget",
3+
"templateUrl": "https://github.com/microsoft/AL-Go-PTE@preview",
44
"repoName": "Ååå",
5-
"templateSha": "679d5cf17e51b1cd558453f429df6e59bf2ce95c"
5+
"templateSha": "becb26e1f895fb75145bbc10535afb19c09bff5c"
66
}

0 commit comments

Comments
 (0)