forked from PowerShell/Microsoft.PowerShell.Archive
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SimpleBuild.ps1
20 lines (14 loc) · 1016 Bytes
/
SimpleBuild.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if ((Test-Path "$PSScriptRoot\out")) {
Remove-Item -Path $PSScriptRoot\out -Recurse -Force
}
New-Item -ItemType directory -Path $PSScriptRoot\out | Out-Null
New-Item -ItemType directory -Path $PSScriptRoot\out\Microsoft.PowerShell.Archive | Out-Null
$OutPath = Join-Path $PSScriptRoot "out"
$OutModulePath = Join-Path $OutPath "Microsoft.PowerShell.Archive"
Copy-Item -Recurse -Path "$PSScriptRoot\Microsoft.PowerShell.Archive" -Destination $OutPath -Force
"Build module location: $OutModulePath" | Write-Verbose -Verbose
"Setting VSTS variable 'BuildOutDir' to '$OutModulePath'" | Write-Verbose -Verbose
Write-Host "##vso[task.setvariable variable=BuildOutDir]$OutModulePath"
$psd1ModuleVersion = (Get-Content -Path "$OutModulePath\Microsoft.PowerShell.Archive.psd1" | Select-String 'ModuleVersion="(.*)"').Matches[0].Groups[1].Value
"Setting VSTS variable 'PackageVersion' to '$psd1ModuleVersion'" | Write-Verbose -Verbose
Write-Host "##vso[task.setvariable variable=PackageVersion]$psd1ModuleVersion"