Public/New-NcrementManifest.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<#
.SYNOPSIS
Instantiates a new [Manifest] object.
 
.PARAMETER Id
The id.
 
.PARAMETER Version
The version number.
 
.PARAMETER Name
The product name.
 
.PARAMETER Description
The product description.
 
.PARAMETER Author
The author.
 
.PARAMETER Company
The owner(s).
 
.PARAMETER Copyright
The copyright.
 
.PARAMETER License
The license.
 
.PARAMETER Website
The product url.
 
.PARAMETER RepositoryUrl
The source control url.
 
.PARAMETER Icon
The product logo.
 
.PARAMETER ReleaseNotes
The release notes.
 
.OUTPUTS
[Manifest]
 
.EXAMPLE
$manifest = New-NcrementManifest -Product "app_name" -Author "me and you";
This example creates a new [Manifest] object.
#>


function New-NcrementManifest
{
    Param(
        [string]$Id = ([Guid]::NewGuid().ToString()),

        [Alias("title", "productName", "product")]
        [string]$Name,

        [string]$Description,
        [string]$Author,
        [string]$Company,
        [string]$Copyright,

        [string]$RepositoryUrl,
        [string]$Website,
        [string]$License,
        [string]$Icon,

        [string]$ReleaseNotes
    )

    return New-Object PSObject -Property @{
        "Path"="";
        "Id"=$Id;
        "Version"=New-Object PSObject -Property @{
            "Major"=0;
            "Minor"=0;
            "Patch"=1;
            "Suffix"="";
        };

        "Name"=$Name;
        "Summary"="";
        "Description"=$Description;
        "Author"=$Author;
        "Company"=$Company;
        "Copyright"=$Copyright;

        "RepositoryUrl"=$RepositoryUrl;
        "Website"=$Website;
        "License"=$License;
        "Icon"=$Icon;

        "ReleaseNotes"=$ReleaseNotes;

        "BranchSuffixMap"=@{
            "master"="";
            "*"="alpha";
        };
    };
}