-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MicroBuild packages to enable signing and more
- Loading branch information
Showing
8 changed files
with
139 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<# | ||
.SYNOPSIS | ||
Installs a NuGet package. | ||
.PARAMETER PackageID | ||
The Package ID to install. | ||
.PARAMETER Version | ||
The version of the package to install. If unspecified, the latest stable release is installed. | ||
.PARAMETER Source | ||
The package source feed to find the package to install from. | ||
.PARAMETER PackagesDir | ||
The directory to install the package to. By default, it uses the Packages folder at the root of the repo. | ||
.PARAMETER ConfigFile | ||
The nuget.config file to use. By default, it uses :/nuget.config. | ||
#> | ||
[CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='Low')] | ||
Param( | ||
[Parameter(Position=1,Mandatory=$true)] | ||
[string]$PackageId, | ||
[Parameter()] | ||
[string]$Version, | ||
[Parameter()] | ||
[string]$Source, | ||
[Parameter()] | ||
[switch]$Prerelease, | ||
[Parameter()] | ||
[string]$PackagesDir="$PSScriptRoot\..\packages", | ||
[Parameter()] | ||
[string]$ConfigFile="$PSScriptRoot\..\nuget.config", | ||
[Parameter()] | ||
[ValidateSet('Quiet','Normal','Detailed')] | ||
[string]$Verbosity='normal' | ||
) | ||
|
||
$nugetPath = & "$PSScriptRoot\Get-NuGetTool.ps1" | ||
|
||
try { | ||
Write-Verbose "Installing $PackageId..." | ||
$nugetArgs = "Install",$PackageId,"-OutputDirectory",$PackagesDir,'-ConfigFile',$ConfigFile | ||
if ($Version) { $nugetArgs += "-Version",$Version } | ||
if ($Source) { $nugetArgs += "-FallbackSource",$Source } | ||
if ($Prerelease) { $nugetArgs += "-Prerelease" } | ||
$nugetArgs += '-Verbosity',$Verbosity | ||
|
||
if ($PSCmdlet.ShouldProcess($PackageId, 'nuget install')) { | ||
$p = Start-Process $nugetPath $nugetArgs -NoNewWindow -Wait -PassThru | ||
if ($p.ExitCode -ne 0) { throw } | ||
} | ||
} finally { | ||
Pop-Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters