Skip to content

Commit c92b9fb

Browse files
committed
Refreshing
1 parent 3f0a93f commit c92b9fb

File tree

7 files changed

+80
-80
lines changed

7 files changed

+80
-80
lines changed

TestingModule/Functions/Invoke-Decimation.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ Function Invoke-Decimation {
5353
IF ($PSCmdlet.ShouldContinue($Path, 'Decimate every file including subdirectories.')) {
5454
Get-ChildItem -Path $Path -File -Recurse |
5555
Where-Object { (Get-Random -Min 1 -Max 11) % 10 -eq 0 } |
56-
Remove-Item -Confirm:$false
56+
Remove-Item -Confirm:$False
5757
}
5858
}
59-
$false {
59+
$False {
6060
# Step 2
6161
IF ($PSCmdlet.ShouldProcess($Path, 'Decimate the contained files.')) {
6262
Get-ChildItem -Path $Path\* -File |
6363
Where-Object { (Get-Random -Min 1 -Max 11) % 10 -eq 0 } |
64-
Remove-Item -Confirm:$false
64+
Remove-Item -Confirm:$False
6565
}
6666
}
6767
}

TestingModule/Functions/Test-AddFile.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Function Test-AddFile {
2323
Write-Verbose "Processing $($MyInvocation.Mycommand)"
2424
$HexNumber = Get-RandomHexNumber
2525
$NewFile = "$($PSScriptRoot)\CSV\AddedFile$Hexnumber.bak"
26-
26+
2727
Add-content -path $NewFile -Value "File for Testing"
2828
}
2929
END{
3030
Write-Verbose "Ending $($MyInvocation.Mycommand)"
31-
return $newfile
31+
return $Newfile
3232
}
3333
}

TestingModule/TestingModule.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ PrivateData = @{
113113
# Prerelease = ''
114114

115115
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
116-
# RequireLicenseAcceptance = $false
116+
# RequireLicenseAcceptance = $False
117117

118118
# External dependent modules of this module
119119
# ExternalModuleDependencies = @()

Tests/BasicPester.Tests.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Describe 'Basic Pester Tests' {
88
$True | Should -Be $True
99
}
1010
It 'A test that should fail' {
11-
$Fail | Should -Be $null
11+
$Fail | Should -Be $Null
1212
}
1313
It 'A test that should be true' {
1414
$VarA | Should -match $VarB
@@ -17,7 +17,7 @@ Describe 'Basic Pester Tests' {
1717
$VarA | Should -Be "Test"
1818
}
1919
It "true is never false" {
20-
$true | Should -not -Be $false
20+
$true | Should -not -Be $False
2121
}
2222
}
2323

@@ -26,30 +26,30 @@ Describe 'Grouping using Context' {
2626
$TestValue = 'ArcaneCode'
2727
$MyArray = 'ArcaneCode', 'http://arcanecode.red', 'http://arcanecode.me'
2828
}
29-
Context 'Test Group 1 Boolean Tests' {
29+
Context 'Test Group 1 Boolean Tests' {
3030
It 'Should be true' { $True | Should -Be $True }
3131
It 'Should be true' { $True | Should -BeTrue }
32-
It 'Should be false' { $False | Should -Be $False }
33-
It 'Should be false' { $False | Should -BeFalse }
32+
It 'Should be false' { $False | Should -Be $False }
33+
It 'Should be false' { $False | Should -BeFalse }
3434
}
35-
Context 'Test Group 2 - Negative Assertions' {
35+
Context 'Test Group 2 - Negative Assertions' {
3636
It 'Should not be true' { $False | Should -Not -BeTrue }
3737
It 'Should be false' { $True | Should -Not -Be $False }
3838
}
39-
Context 'Test Group 3 - Calculations' {
39+
Context 'Test Group 3 - Calculations' {
4040
It '$X Should be 42' {
41-
$X = 42 * 1
41+
$X = 42 * 1
4242
$X | Should -Be 42
4343
}
44-
44+
4545
It 'Should be greater than or equal to 33' {
4646
$Y = 3 * 11
4747
$Y | Should -BeGreaterOrEqual 33
48-
}
48+
}
4949
It 'Should with a calculated value' {
5050
$Y = 3
5151
($Y * 11) | Should -BeGreaterThan 30
52-
}
52+
}
5353
}
5454
Context 'Test Group 4 - String tests' {
5555
It "Testing to see if <TestValue> matches arcane" {

Tests/Module.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ Describe "Validating commands are viable" -Tag 'Command_Validation' {
6565
$File.Fullname | Should -Exist
6666

6767
$Contents = Get-Content -Path $File.Fullname -ErrorAction Stop
68-
$Errors = $null
69-
$null = [System.Management.Automation.PSParser]::Tokenize($Contents, [ref]$Errors)
68+
$Errors = $Null
69+
$Null = [System.Management.Automation.PSParser]::Tokenize($Contents, [ref]$Errors)
7070
$Errors.Count | Should -Be 0
7171

7272
}
@@ -112,8 +112,8 @@ Describe "Validating commands are viable" -Tag 'Command_Validation' {
112112
$File.Fullname | Should -Exist
113113

114114
$Contents = Get-Content -Path $File.Fullname -ErrorAction Stop
115-
$Errors = $null
116-
$null = [System.Management.Automation.PSParser]::Tokenize($Contents, [ref]$Errors)
115+
$Errors = $Null
116+
$Null = [System.Management.Automation.PSParser]::Tokenize($Contents, [ref]$Errors)
117117
$Errors.Count | Should -Be 0
118118

119119
}

Tests/Ping-Computer.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Describe 'Mock Ping-Computer' {
44
Ping-Computer -ComputerName 'DOESNOTMATTER'
55
}
66

7-
it 'should return $false when the computer is offline' {
8-
mock 'Test-Connection' -MockWith { $false }
7+
it 'should return $False when the computer is offline' {
8+
mock 'Test-Connection' -MockWith { $False }
99
Ping-Computer -ComputerName 'DOESNOTMATTER'
1010
}
1111
}
@@ -15,7 +15,7 @@ describe 'Test Ping-Computer' {
1515
Ping-Computer -ComputerName $env:COMPUTERNAME | Should -Be $true
1616
}
1717

18-
it 'should return $false when the computer is offline' {
19-
Ping-Computer -ComputerName 'DOESNOTMATTER' | Should -Be $false
18+
it 'should return $False when the computer is offline' {
19+
Ping-Computer -ComputerName 'DOESNOTMATTER' | Should -Be $False
2020
}
2121
}

build.ps1

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ task DebugBuild -if ($Configuration -eq "debug") {
9494
$privateFunctions = Get-ChildItem -Path ".\Source\Private\*.ps1"
9595
try {
9696
Write-Verbose -Message "Appending Public functions to the psm file"
97-
$functionsToExport = New-Object -TypeName System.Collections.ArrayList
98-
foreach($function in $publicFunctions.Name){
99-
write-Verbose -Message "Exporting function: $(($function.split('.')[0]).ToString())"
100-
$functionsToExport.Add(($function.split('.')[0]).ToString())
97+
$FunctionsToExport = New-Object -TypeName System.Collections.ArrayList
98+
foreach($Function in $publicFunctions.Name){
99+
write-Verbose -Message "Exporting function: $(($Function.split('.')[0]).ToString())"
100+
$FunctionsToExport.Add(($Function.split('.')[0]).ToString())
101101
}
102-
Update-ModuleManifest -Path ".\Output\temp\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1" -FunctionsToExport $functionsToExport
102+
Update-ModuleManifest -Path ".\Output\temp\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1" -FunctionsToExport $FunctionsToExport
103103
}
104104
catch {
105105
throw "Failed updating Module manifest with public functions"
@@ -108,51 +108,51 @@ task DebugBuild -if ($Configuration -eq "debug") {
108108
Write-Verbose -Message "Building the .psm1 file"
109109
Write-Verbose -Message "Appending Public Functions"
110110
Add-Content -Path $ModuleFile -Value "### --- PUBLIC FUNCTIONS --- ###"
111-
foreach($function in $publicFunctions.Name){
111+
foreach($Function in $publicFunctions.Name){
112112
try {
113-
Write-Verbose -Message "Updating the .psm1 file with function: $($function)"
114-
$content = Get-Content -Path ".\Source\Public\$($function)"
115-
Add-Content -Path $ModuleFile -Value "#Region - $function"
113+
Write-Verbose -Message "Updating the .psm1 file with function: $($Function)"
114+
$content = Get-Content -Path ".\Source\Public\$($Function)"
115+
Add-Content -Path $ModuleFile -Value "#Region - $Function"
116116
Add-Content -Path $ModuleFile -Value $content
117117
if($ExportAlias.IsPresent){
118-
$AliasSwitch = $false
119-
$Sel = Select-String -Path ".\Source\Public\$($function)" -Pattern "CmdletBinding" -Context 0,1
120-
$mylist = $Sel.ToString().Split([Environment]::NewLine)
121-
foreach($s in $mylist){
118+
$AliasSwitch = $False
119+
$Sel = Select-String -Path ".\Source\Public\$($Function)" -Pattern "CmdletBinding" -Context 0,1
120+
$Mylist = $Sel.ToString().Split([Environment]::NewLine)
121+
foreach($s in $Mylist){
122122
if($s -match "Alias"){
123123
$alias = (($s.split(":")[2]).split("(")[1]).split(")")[0]
124-
Write-Verbose -Message "Exporting Alias: $($alias) to Function: $($function)"
125-
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($function.split('.')[0]).ToString()) -Alias $alias"
124+
Write-Verbose -Message "Exporting Alias: $($alias) to Function: $($Function)"
125+
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($Function.split('.')[0]).ToString()) -Alias $alias"
126126
$AliasSwitch = $true
127127
}
128128
}
129-
if($AliasSwitch -eq $false){
130-
Write-Verbose -Message "No alias was found in function: $($function))"
131-
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($function.split('.')[0]).ToString())"
129+
if($AliasSwitch -eq $False){
130+
Write-Verbose -Message "No alias was found in function: $($Function))"
131+
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($Function.split('.')[0]).ToString())"
132132
}
133133
}
134134
else {
135-
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($function.split('.')[0]).ToString())"
135+
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($Function.split('.')[0]).ToString())"
136136
}
137-
Add-Content -Path $ModuleFile -Value "#EndRegion - $function"
137+
Add-Content -Path $ModuleFile -Value "#EndRegion - $Function"
138138
}
139139
catch {
140-
throw "Failed adding content to .psm1 for function: $($function)"
140+
throw "Failed adding content to .psm1 for function: $($Function)"
141141
}
142142
}
143143

144144
Write-Verbose -Message "Appending Private functions"
145145
Add-Content -Path $ModuleFile -Value "### --- PRIVATE FUNCTIONS --- ###"
146-
foreach($function in $privateFunctions.Name){
146+
foreach($Function in $privateFunctions.Name){
147147
try {
148-
Write-Verbose -Message "Updating the .psm1 file with function: $($function)"
149-
$content = Get-Content -Path ".\Source\Private\$($function)"
150-
Add-Content -Path $ModuleFile -Value "#Region - $function"
148+
Write-Verbose -Message "Updating the .psm1 file with function: $($Function)"
149+
$content = Get-Content -Path ".\Source\Private\$($Function)"
150+
Add-Content -Path $ModuleFile -Value "#Region - $Function"
151151
Add-Content -Path $ModuleFile -Value $content
152-
Add-Content -Path $ModuleFile -Value "#EndRegion - $function"
152+
Add-Content -Path $ModuleFile -Value "#EndRegion - $Function"
153153
}
154154
catch {
155-
throw "Failed adding content to .psm1 for function: $($function)"
155+
throw "Failed adding content to .psm1 for function: $($Function)"
156156
}
157157
}
158158
}
@@ -193,7 +193,7 @@ task Build -if($Configuration -eq "Release"){
193193
Remove-Item -Path ".\Output\$($ModuleName)" -Recurse -Force
194194
}
195195
try {
196-
196+
197197
New-Item -Path ".\Output\$($ModuleName)\$($ModuleVersion)" -ItemType Directory
198198
}
199199
catch {
@@ -212,12 +212,12 @@ task Build -if($Configuration -eq "Release"){
212212
Write-Verbose -Message "Updating Module Manifest with Public Functions"
213213
try {
214214
Write-Verbose -Message "Appending Public functions to the psm file"
215-
$functionsToExport = New-Object -TypeName System.Collections.ArrayList
216-
foreach($function in $publicFunctions.Name){
217-
write-Verbose -Message "Exporting function: $(($function.split('.')[0]).ToString())"
218-
$functionsToExport.Add(($function.split('.')[0]).ToString())
215+
$FunctionsToExport = New-Object -TypeName System.Collections.ArrayList
216+
foreach($Function in $publicFunctions.Name){
217+
write-Verbose -Message "Exporting function: $(($Function.split('.')[0]).ToString())"
218+
$FunctionsToExport.Add(($Function.split('.')[0]).ToString())
219219
}
220-
Update-ModuleManifest -Path ".\Output\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1" -FunctionsToExport $functionsToExport
220+
Update-ModuleManifest -Path ".\Output\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1" -FunctionsToExport $FunctionsToExport
221221
}
222222
catch {
223223
throw "Failed updating Module manifest with public functions"
@@ -226,51 +226,51 @@ task Build -if($Configuration -eq "Release"){
226226
Write-Verbose -Message "Building the .psm1 file"
227227
Write-Verbose -Message "Appending Public Functions"
228228
Add-Content -Path $ModuleFile -Value "### --- PUBLIC FUNCTIONS --- ###"
229-
foreach($function in $publicFunctions.Name){
229+
foreach($Function in $publicFunctions.Name){
230230
try {
231-
Write-Verbose -Message "Updating the .psm1 file with function: $($function)"
232-
$content = Get-Content -Path ".\Source\Public\$($function)"
233-
Add-Content -Path $ModuleFile -Value "#Region - $function"
231+
Write-Verbose -Message "Updating the .psm1 file with function: $($Function)"
232+
$content = Get-Content -Path ".\Source\Public\$($Function)"
233+
Add-Content -Path $ModuleFile -Value "#Region - $Function"
234234
Add-Content -Path $ModuleFile -Value $content
235235
if($ExportAlias.IsPresent){
236-
$AliasSwitch = $false
237-
$Sel = Select-String -Path ".\Source\Public\$($function)" -Pattern "CmdletBinding" -Context 0,1
238-
$mylist = $Sel.ToString().Split([Environment]::NewLine)
239-
foreach($s in $mylist){
236+
$AliasSwitch = $False
237+
$Sel = Select-String -Path ".\Source\Public\$($Function)" -Pattern "CmdletBinding" -Context 0,1
238+
$Mylist = $Sel.ToString().Split([Environment]::NewLine)
239+
foreach($s in $Mylist){
240240
if($s -match "Alias"){
241241
$alias = (($s.split(":")[2]).split("(")[1]).split(")")[0]
242-
Write-Verbose -Message "Exporting Alias: $($alias) to Function: $($function)"
243-
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($function.split('.')[0]).ToString()) -Alias $alias"
242+
Write-Verbose -Message "Exporting Alias: $($alias) to Function: $($Function)"
243+
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($Function.split('.')[0]).ToString()) -Alias $alias"
244244
$AliasSwitch = $true
245245
}
246246
}
247-
if($AliasSwitch -eq $false){
248-
Write-Verbose -Message "No alias was found in function: $($function))"
249-
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($function.split('.')[0]).ToString())"
247+
if($AliasSwitch -eq $False){
248+
Write-Verbose -Message "No alias was found in function: $($Function))"
249+
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($Function.split('.')[0]).ToString())"
250250
}
251251
}
252252
else {
253-
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($function.split('.')[0]).ToString())"
253+
Add-Content -Path $ModuleFile -Value "Export-ModuleMember -Function $(($Function.split('.')[0]).ToString())"
254254
}
255-
Add-Content -Path $ModuleFile -Value "#EndRegion - $function"
255+
Add-Content -Path $ModuleFile -Value "#EndRegion - $Function"
256256
}
257257
catch {
258-
throw "Failed adding content to .psm1 for function: $($function)"
258+
throw "Failed adding content to .psm1 for function: $($Function)"
259259
}
260260
}
261261

262262
Write-Verbose -Message "Appending Private functions"
263263
Add-Content -Path $ModuleFile -Value "### --- PRIVATE FUNCTIONS --- ###"
264-
foreach($function in $privateFunctions.Name){
264+
foreach($Function in $privateFunctions.Name){
265265
try {
266-
Write-Verbose -Message "Updating the .psm1 file with function: $($function)"
267-
$content = Get-Content -Path ".\Source\Private\$($function)"
268-
Add-Content -Path $ModuleFile -Value "#Region - $function"
266+
Write-Verbose -Message "Updating the .psm1 file with function: $($Function)"
267+
$content = Get-Content -Path ".\Source\Private\$($Function)"
268+
Add-Content -Path $ModuleFile -Value "#Region - $Function"
269269
Add-Content -Path $ModuleFile -Value $content
270-
Add-Content -Path $ModuleFile -Value "#EndRegion - $function"
270+
Add-Content -Path $ModuleFile -Value "#EndRegion - $Function"
271271
}
272272
catch {
273-
throw "Failed adding content to .psm1 for function: $($function)"
273+
throw "Failed adding content to .psm1 for function: $($Function)"
274274
}
275275
}
276276

0 commit comments

Comments
 (0)