@@ -14,29 +14,31 @@ if (-not (Test-Path "$root/Tools/reportgenerator.exe")) {
14
14
Write-Host - Foreground Green " Download dotnet-reportgenerator-globaltool...OK."
15
15
}
16
16
17
+ $VsWherePath = " ${env: PROGRAMFILES(X86)} \Microsoft Visual Studio\Installer\vswhere.exe"
18
+ $VsPath = $ (& $VsWherePath - latest - property installationPath)
19
+ $msbuildPath = Join-Path - Path $VsPath - ChildPath " \MSBuild"
20
+
17
21
# Install .NET nanoFramework build components
22
+ if (! (Test-Path " $msbuildPath /nanoFramework" )) {
23
+ Write-Host " Installing .NET nanoFramework VS extension..."
18
24
19
- Write-Host " Installing .NET nanoFramework VS extension..."
25
+ [System.Net.WebClient ]$webClient = New-Object System.Net.WebClient
26
+ $webClient.UseDefaultCredentials = $true
20
27
21
- [System.Net.WebClient ]$webClient = New-Object System.Net.WebClient
22
- $webClient.UseDefaultCredentials = $true
28
+ $vsixFeedXml = Join-Path - Path $tempDir - ChildPath " vs-extension-feed.xml"
29
+ $webClient.DownloadFile (" http://vsixgallery.com/feed/author/nanoframework" , $vsixFeedXml )
30
+ [xml ]$feedDetails = Get-Content $vsixFeedXml
23
31
24
- $vsixFeedXml = Join-Path - Path $tempDir - ChildPath " vs-extension-feed.xml"
25
- $webClient.DownloadFile (" http://vsixgallery.com/feed/author/nanoframework" , $vsixFeedXml )
26
- [xml ]$feedDetails = Get-Content $vsixFeedXml
32
+ $extensionUrl = $feedDetails.feed.entry [1 ].content.src
33
+ $vsixPath = Join-Path - Path $tempDir - ChildPath " nf-extension.zip"
34
+ $extensionVersion = $feedDetails.feed.entry [0 ].Vsix.Version
35
+ $webClient.DownloadFile ($extensionUrl , $vsixPath )
36
+ Expand-Archive - LiteralPath $vsixPath - DestinationPath $tempDir \nf- extension\ | Write-Host
27
37
28
- $extensionUrl = $feedDetails.feed.entry [1 ].content.src
29
- $vsixPath = Join-Path - Path $tempDir - ChildPath " nf-extension.zip"
30
- $extensionVersion = $feedDetails.feed.entry [0 ].Vsix.Version
31
- $webClient.DownloadFile ($extensionUrl , $vsixPath )
32
- Expand-Archive - LiteralPath $vsixPath - DestinationPath $tempDir \nf- extension\ | Write-Host
38
+ Copy-Item - Path " $tempDir \nf-extension\`$ MSBuild\nanoFramework" - Destination $msbuildPath - Recurse
33
39
34
- $VsWherePath = " ${env: PROGRAMFILES(X86)} \Microsoft Visual Studio\Installer\vswhere.exe"
35
- $VsPath = $ (& $VsWherePath - latest - property installationPath)
36
- $msbuildPath = Join-Path - Path $VsPath - ChildPath " \MSBuild"
37
- Copy-Item - Path " $tempDir \nf-extension\`$ MSBuild\nanoFramework" - Destination $msbuildPath - Recurse
38
-
39
- Write-Host " Installed VS extension v$extensionVersion "
40
+ Write-Host " Installed VS extension v$extensionVersion "
41
+ }
40
42
41
43
# Cleanup
42
44
[system.io.Directory ]::Delete($tempDir , $true ) | out-null
0 commit comments