Skip to content

Commit c911728

Browse files
committed
feat: Add ability to install particular version instead of master
1 parent fda4cfa commit c911728

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: Install.ps1

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[CmdletBinding()]
22
param (
3-
[string]$Path
3+
[string]$Path,
4+
[string]$Version = 'master'
45
)
56

67
$localpath = $(Join-Path -Path (Split-Path -Path $profile) -ChildPath '\Modules\ReportingServicesTools')
@@ -39,7 +40,7 @@ if ((Get-Command -Module ReportingServicesTools).count -ne 0)
3940
Remove-Module ReportingServicesTools -ErrorAction Stop
4041
}
4142

42-
$url = 'https://github.com/Microsoft/ReportingServicesTools/archive/master.zip'
43+
$url = "https://github.com/Microsoft/ReportingServicesTools/archive/$Version.zip"
4344

4445
$temp = ([System.IO.Path]::GetTempPath()).TrimEnd("\")
4546
$zipfile = "$temp\ReportingServicesTools.zip"
@@ -91,11 +92,11 @@ $shell = New-Object -COM Shell.Application
9192
$zipPackage = $shell.NameSpace($zipfile)
9293
$destinationFolder = $shell.NameSpace($temp)
9394
$destinationFolder.CopyHere($zipPackage.Items())
94-
Move-Item -Path "$temp\ReportingServicesTools-master\*" $path
95+
Move-Item -Path "$temp\ReportingServicesTools-$Version\*" $path
9596
Write-Output "ReportingServicesTools has been successfully downloaded to $path!"
9697

9798
Write-Output "Cleaning up..."
98-
Remove-Item -Path "$temp\ReportingServicesTools-master"
99+
Remove-Item -Path "$temp\ReportingServicesTools-$Version"
99100
Remove-Item -Path $zipfile
100101

101102
Write-Output "Importing ReportingServicesTools Module..."

0 commit comments

Comments
 (0)