Skip to content

Commit d804376

Browse files
committed
Merge branch 'pester'
2 parents 3373f15 + c989802 commit d804376

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

buildmodule.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function ZipFiles {
4444
$Cleanup = Remove-Item $TempZipFullPath -Recurse
4545
}
4646

47-
47+
$VerbosePrefix = "buildmodule"
4848
$ScriptPath = Split-Path $($MyInvocation.MyCommand).Path
4949
$ModuleName = Split-Path $ScriptPath -Leaf
5050

@@ -111,14 +111,16 @@ $CsOutput = ""
111111
# Add C-Sharp
112112

113113
$AssemblyRx = [regex] '^using\ .+?;'
114-
$NameSpaceStartRx = [regex] "namespace $ModuleName {"
114+
$NameSpaceStartRx = [regex] 'namespace (?<namespace>[^\ ]+?) {'
115115
$NameSpaceStopRx = [regex] '^}$'
116116

117+
117118
$Assemblies = @()
118119
$CSharpContent = @()
119120

120121
$c = 0
121122
foreach ($f in $(ls $CsPath)) {
123+
Write-Verbose "$VerbosePrefix adding $($f.Name)"
122124
foreach ($l in (gc $f.FullName)) {
123125
$AssemblyMatch = $AssemblyRx.Match($l)
124126
$NameSpaceStartMatch = $NameSpaceStartRx.Match($l)
@@ -130,6 +132,7 @@ foreach ($f in $(ls $CsPath)) {
130132
}
131133

132134
if ($NameSpaceStartMatch.Success) {
135+
$NameSpace = $NameSpaceStartMatch.Groups['namespace'].Value
133136
$AddContent = $true
134137
continue
135138
}
@@ -140,15 +143,14 @@ foreach ($f in $(ls $CsPath)) {
140143
}
141144

142145
if ($AddContent) {
146+
Write-Verbose "$VerbosePrefix $l"
143147
$CSharpContent += $l
144148
}
145149
}
146150
}
147151

148-
#$Assemblies | Select -Unique | sort -Descending
149-
150152
$CSharpOutput = $Assemblies | Select -Unique | sort -Descending
151-
$CSharpOutput += "namespace $ModuleName {"
153+
$CSharpOutput += "namespace $NameSpace {"
152154
$CSharpOutput += $CSharpContent
153155
$CSharpOutput += '}'
154156

@@ -168,6 +170,7 @@ Add-Type -ReferencedAssemblies @(
168170
$Output = $CmdletHeader
169171

170172
foreach ($l in $(ls $CmdletPath)) {
173+
if ($l.Name -match "\.Tests\.") { continue }
171174
$Contents = gc $l.FullName
172175
Write-Verbose $l.FullName
173176
$Output += $FunctionHeader

prtgshell2.cs

71.8 KB
Binary file not shown.

prtgshell2.psd1

0 Bytes
Binary file not shown.

prtgshell2.psm1

-2 Bytes
Binary file not shown.

src/cmdlets/Set-PrtgError.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
function Set-PrtgError {
32
Param (
43
[Parameter(Mandatory=$True,Position=0)]

0 commit comments

Comments
 (0)