File tree 7 files changed +93
-5
lines changed
7 files changed +93
-5
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <Configuration >
3
+ <ViewDefinitions >
4
+
5
+ <View >
6
+ <Name >ScriptLogger.Configuration</Name >
7
+ <ViewSelectedBy >
8
+ <TypeName >ScriptLogger.Configuration</TypeName >
9
+ </ViewSelectedBy >
10
+ <TableControl >
11
+ <TableHeaders >
12
+ <TableColumnHeader >
13
+ <Width >10</Width >
14
+ </TableColumnHeader >
15
+ <TableColumnHeader >
16
+ <Width >12</Width >
17
+ </TableColumnHeader >
18
+ <TableColumnHeader />
19
+ <TableColumnHeader >
20
+ <Width >10</Width >
21
+ </TableColumnHeader >
22
+ <TableColumnHeader >
23
+ <Width >10</Width >
24
+ </TableColumnHeader >
25
+ <TableColumnHeader >
26
+ <Width >10</Width >
27
+ </TableColumnHeader >
28
+ </TableHeaders >
29
+ <TableRowEntries >
30
+ <TableRowEntry >
31
+ <TableColumnItems >
32
+ <TableColumnItem >
33
+ <PropertyName >Enabled</PropertyName >
34
+ </TableColumnItem >
35
+ <TableColumnItem >
36
+ <PropertyName >Level</PropertyName >
37
+ </TableColumnItem >
38
+ <TableColumnItem >
39
+ <PropertyName >Path</PropertyName >
40
+ </TableColumnItem >
41
+ <TableColumnItem >
42
+ <PropertyName >LogFile</PropertyName >
43
+ </TableColumnItem >
44
+ <TableColumnItem >
45
+ <PropertyName >EventLog</PropertyName >
46
+ </TableColumnItem >
47
+ <TableColumnItem >
48
+ <PropertyName >Console</PropertyName >
49
+ </TableColumnItem >
50
+ </TableColumnItems >
51
+ </TableRowEntry >
52
+ </TableRowEntries >
53
+ </TableControl >
54
+ </View >
55
+
56
+ </ViewDefinitions >
57
+ </Configuration >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <Types >
3
+
4
+ </Types >
Original file line number Diff line number Diff line change 1
1
@ {
2
2
RootModule = ' ScriptLogger.psm1'
3
- ModuleVersion = ' 1.1.0 '
3
+ ModuleVersion = ' 1.1.1 '
4
4
GUID = ' 0E1AF375-67C1-460A-A247-045C5D2B54AA'
5
5
Author = ' Claudio Spizzi'
6
6
Copyright = ' Copyright (c) 2016 by Claudio Spizzi. Licensed under MIT license.'
7
7
Description = ' PowerShell Module to provide logging capabilities for PowerShell Controller Scripts.'
8
8
PowerShellVersion = ' 3.0'
9
9
ScriptsToProcess = @ ()
10
- TypesToProcess = @ ()
11
- FormatsToProcess = @ ()
10
+ TypesToProcess = @ (
11
+ ' Resources/ScriptLogger.Types.ps1xml'
12
+ )
13
+ FormatsToProcess = @ (
14
+ ' Resources/ScriptLogger.Formats.ps1xml'
15
+ )
12
16
FunctionsToExport = @ (
13
17
' Start-ScriptLogger' ,
14
18
' Stop-ScriptLogger' ,
Original file line number Diff line number Diff line change 41
41
<Compile Include =" ScriptLogger.psd1" />
42
42
<Compile Include =" ScriptLogger.psm1" />
43
43
<Compile Include =" Scripts\build.ps1" />
44
+ <Compile Include =" Scripts\debug.ps1" />
44
45
<Compile Include =" Scripts\test.ps1" />
45
46
<Compile Include =" Tests\Get-ScriptLogger.Tests.ps1" />
46
47
<Compile Include =" Tests\Set-ScriptLogger.Tests.ps1" />
54
55
<ItemGroup >
55
56
<Folder Include =" Examples\" />
56
57
<Folder Include =" Functions\" />
58
+ <Folder Include =" Resources\" />
57
59
<Folder Include =" Tests\" />
58
60
<Folder Include =" Scripts\" />
59
61
</ItemGroup >
62
+ <ItemGroup >
63
+ <Content Include =" Resources\ScriptLogger.Formats.ps1xml" />
64
+ <Content Include =" Resources\ScriptLogger.Types.ps1xml" />
65
+ </ItemGroup >
60
66
<Import Project =" $(MSBuildBinPath)\Microsoft.CSharp.targets" />
61
67
<Target Name =" Build" />
62
68
</Project >
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ New-Item -Path $Target -ItemType Directory | Out-Null
10
10
# Copy all module items
11
11
Copy-Item - Path " $Source \Examples" - Destination $Target - Recurse
12
12
Copy-Item - Path " $Source \Functions" - Destination $Target - Recurse
13
+ Copy-Item - Path " $Source \Resources" - Destination $Target - Recurse
13
14
Copy-Item - Path " $Source \Tests" - Destination $Target - Recurse
14
15
Copy-Item - Path " $Source \$Module .psd1" - Destination $Target
15
16
Copy-Item - Path " $Source \$Module .psm1" - Destination $Target
Original file line number Diff line number Diff line change
1
+
2
+ # Import the module for debugging
3
+ Import-Module " $PSScriptRoot \..\ScriptLogger.psd1" - Force
4
+
5
+ # Execute debugging commands
6
+
7
+
Original file line number Diff line number Diff line change @@ -34,7 +34,16 @@ InModuleScope ScriptLogger {
34
34
35
35
Mock Get-Date - ModuleName ScriptLogger { [DateTime ] ' 2000-12-31 01:02:03' }
36
36
37
- Mock Write-Information - ModuleName ScriptLogger - ParameterFilter { $MessageData -eq ' My Information' }
37
+ if ($PSVersionTable.PSVersion -lt ' 5.0' )
38
+ {
39
+ $InformationMockName = ' Write-Host'
40
+ Mock $InformationMockName - ModuleName ScriptLogger - ParameterFilter { $Object -eq ' My Information' }
41
+ }
42
+ else
43
+ {
44
+ $InformationMockName = ' Write-Information'
45
+ Mock $InformationMockName - ModuleName ScriptLogger - ParameterFilter { $MessageData -eq ' My Information' }
46
+ }
38
47
39
48
BeforeAll {
40
49
@@ -78,7 +87,7 @@ InModuleScope ScriptLogger {
78
87
79
88
Write-InformationLog - Message ' My Information'
80
89
81
- Assert-MockCalled - CommandName ' Write-Information ' - Times 1 - Exactly
90
+ Assert-MockCalled - CommandName $InformationMockName - Times 1 - Exactly
82
91
}
83
92
84
93
AfterEach {
You can’t perform that action at this time.
0 commit comments