-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.ps1
32 lines (27 loc) · 2.1 KB
/
setup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
param(
[alias("env")]
$environment = ''
)
function GetModulePath([string]$module){
$commonPath = @(Get-ChildItem -r -Path packages -filter $module | Sort-Object FullName -descending)
return $commonPath[0].FullName
}
function DownloadNuget(){
new-item (Get-Location).Path -name .nuget -type directory -force
$destination = (Get-Location).Path + '\.nuget\nuget.exe'
Invoke-WebRequest -Uri "http://nuget.org/nuget.exe" -OutFile $destination
}
function DownloadAndImportModules(){
.nuget\nuget.exe install psake -OutputDirectory packages -NoCache
.nuget\nuget.exe install VersionOne.Build.Common -Source http://www.myget.org/F/versionone/api/v2/ -OutputDirectory packages -NoCache
$psakePath = GetModulePath "psake.psm1"
Import-Module $psakePath
}
function CopyCommonToRoot(){
$commonPath = GetModulePath "VersionOne.Build.Common.ps1"
Copy-Item -Path $commonPath -Destination (Get-Location).Path -Force
}
DownloadNuget
DownloadAndImportModules
CopyCommonToRoot
Invoke-psake VersionOne.Build.Common.ps1 $environment