diff --git a/build/vsts-build.ps1 b/build/vsts-build.ps1 index 7a02e8f..37e5858 100644 --- a/build/vsts-build.ps1 +++ b/build/vsts-build.ps1 @@ -12,7 +12,8 @@ if (-not $env:SYSTEM_DEFAULTWORKINGDIRECTORY) # Prepare build folder $item = New-Item -Path $env:TEMP -Name "Build" -ItemType Directory -Force Write-PSFMessage -Level Host -Message "Building in $($item.FullName)" -Copy-Item -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -Destination $item.FullName -Recurse +Copy-Item -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -Destination "$($item.FullName)\" -Recurse +Import-Module "$($item.FullName)\PSModuleDevelopment\PSModuleDevelopment.psd1" # Build Templates Write-PSFMessage -Level Host -Message "Building templates" @@ -20,7 +21,7 @@ Write-PSFMessage -Level Host -Message " Creating root folder" $templateBuild = New-Item -Path $item.FullName -Name "Templates" -ItemType Directory -Force Write-PSFMessage -Level Host -Message " Executing package compilation" & "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\templates\build.ps1" -Path $templateBuild.FullName -Write-PSFMessage -Level Host -Message " Merging tempalte packages into build" +Write-PSFMessage -Level Host -Message " Merging template packages into build" Copy-Item -Path "$($templateBuild.FullName)\output\*" -Destination "$($item.FullName)\PSModuleDevelopment\internal\templates" -Force # Publish to gallery @@ -29,4 +30,5 @@ if ($env:BUILD_BUILDURI -like "vstfs*") Write-PSFMessage -Level Host -Message "Publishing to gallery" if ($WhatIf -or -not $ApiKey) { Publish-Module -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -NuGetApiKey $ApiKey -Force -WhatIf } else { Publish-Module -Path "$($env:SYSTEM_DEFAULTWORKINGDIRECTORY)\PSModuleDevelopment" -NuGetApiKey $ApiKey -Force } -} \ No newline at end of file +} +else { Write-PSFMessage -Level Host -Message "Skipping publish to gallery" } \ No newline at end of file