-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-GitPub.ps.ps1
46 lines (36 loc) · 1.1 KB
/
Get-GitPub.ps.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
function Get-GitPub
{
<#
.SYNOPSIS
Gets GitPub
.DESCRIPTION
Gets GitPub.
Returns the version and currently loaded Publishers and Sources.
.EXAMPLE
Get-GitPub
.LINK
Publish-GitPub
#>
param()
process {
$sourceFunctions =
all functions that {
foreach ($attr in $this.ScriptBlock.Attributes) {
if ($attr -is [Reflection.AssemblyMetaDataAttribute] -and $attr.Key -eq 'GitPub.Source') { $true; break }
}
} are GitPub.Sources
$publisherFunctions =
all functions that {
foreach ($attr in $this.ScriptBlock.Attributes) {
if ($attr -is [Reflection.AssemblyMetaDataAttribute] -and
($attr.Key -eq 'GitPub.Publisher')) { $true; break }
}
} are GitPub.Publishers
[PSCustomObject]@{
PSTypeName = 'GitPub'
Version = $MyInvocation.MyCommand.Module.Version
Sources = $sourceFunctions
Publishers = $publisherFunctions
}
}
}