Skip to content

Instantly share code, notes, and snippets.

@Kyle-Muir
Created September 21, 2015 20:48
Show Gist options
  • Save Kyle-Muir/c69bee8c99b61221af48 to your computer and use it in GitHub Desktop.
Save Kyle-Muir/c69bee8c99b61221af48 to your computer and use it in GitHub Desktop.
Used for creating Nuget packages and pushing to a remote Nuget server secured with an API key
function Build-Octopack ($thingToBuild, $configuration, $buildNumber, $nugetServer, $nugetApiKey, $visualStudioVersion = "12.0") {
set-alias msb "$env:windir\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
exec {
msb $thingToBuild /t:Build /p:Configuration=$configuration /p:AllowedReferenceRelatedFileExtensions=none /p:RunCodeAnalysis=Never /p:DebugSymbols=false /p:DebugType=None /m /nologo /p:VisualStudioVersion=$visualStudioVersion /p:RunOctopack=true "/p:OctoPackNuGetProperties=buildNumber=$buildNumber" /p:OctoPackPublishApiKey=$nugetApiKey /p:OctoPackPublishPackageToHttp=$nugetServer /p:OctoPackPackageVersion=$buildNumber
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment