This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
package.ps1
47 lines (42 loc) · 2.12 KB
/
package.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
param(
[parameter(Mandatory)]
$Version,
$Folder = $env:SIGNED_OUTPUT_PATH,
$OutputDirectory = ([System.IO.Path]::GetTempPath())
)
$nuspec = @'
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>PSPackageProject</id>
<version>{0}</version>
<authors>Microsoft Corporation</authors>
<owners>Microsoft Corporation</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/TravisEz13/PsAzDevOpsExt/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/TravisEz13/PsAzDevOpsExt</projectUrl>
<description>Module to help with building and publishing PowerShell packages</description>
<releaseNotes></releaseNotes>
<copyright>(c) Microsoft Corporation. All rights reserved</copyright>
<tags>PSModule PSIncludes_Function PSFunction_Initialize-PSPackageProject PSFunction_Invoke-PSPackageProjectTest PSFunction_Add-PSPackageProjectCmdletHelp PSFunction_Export-PSPackageProjectHelp PSFunction_New-PSPackageProjectHelp PSFunction_Invoke-PSPackageProjectBuild PSFunction_Invoke-PSPackageProjectPublish PSFunction_Get-PSPackageProjectConfiguration PSCommand_Initialize-PSPackageProject PSCommand_Invoke-PSPackageProjectTest PSCommand_Add-PSPackageProjectCmdletHelp PSCommand_Export-PSPackageProjectHelp PSCommand_New-PSPackageProjectHelp PSCommand_Invoke-PSPackageProjectBuild PSCommand_Invoke-PSPackageProjectPublish PSCommand_Get-PSPackageProjectConfiguration</tags>
<dependencies>
<dependency id="platyPS" version="0.14.0" />
<dependency id="Pester" version="4.8.1" />
<dependency id="PSScriptAnalyzer" version="1.18.0" />
</dependencies>
</metadata>
<files>
<file src="**\*.*" target="" />
</files>
</package>
'@
$actualNuspec = $nuspec -f $Version
$nuspecPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath "test.nuspec"
$actualNuspec | Out-File -FilePath $nuspecPath -Encoding utf8NoBOM
Push-Location $Folder
try {
nuget pack $nuspecPath -NoPackageAnalysis -OutputDirectory $OutputDirectory
}
finally {
Pop-Location
}