You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -26,11 +26,11 @@ This project was to just offer people a easy way to quickly add the ability to o
26
26
27
27
### Class Version
28
28
29
-
The class Version is the preffered version however this version is limited to PowerShell Version 5.0 and greater and utilises the *Using* statement.
29
+
The class Version is the preferred version however this version is limited to PowerShell Version 5.0 and greater and utilizes the *Using* statement.
30
30
31
31
### Module Version
32
32
33
-
The Module Version is available for those prefering to use *Import-Module* and those using older versions of PowerShell as the Class version will not work on PowerShell versions prior to 5.0.
33
+
The Module Version is available for those preferring to use *Import-Module* and those using older versions of PowerShell as the Class version will not work on PowerShell versions prior to 5.0.
34
34
35
35
<palign="right">(<ahref="#top">back to top</a>)</p>
36
36
@@ -43,36 +43,42 @@ To get a local copy up and running follow these simple example steps.
43
43
### Prerequisites
44
44
45
45
This is an example of how to list things you need to use the software and how to install them.
46
+
46
47
* PowerShell version 2.0 or greater - Module Version.
47
48
* PowerShell version 5.0 or greater - Either version.
48
49
49
50
### Installation of Class Version
50
51
51
-
1. Download the <ahref="https://github.com/captainqwerty/Write-Log/release">latest release</a>.
52
+
1. Download the <ahref="https://github.com/PowershellGroup/Write-Log-Module/release">latest release</a>.
52
53
2. Extract the zipped folder.
53
54
3. Place the "Write-Log" folder in your project's folder or in a location the script can access under the context it will be ran.
54
-
4. Add the Using satement pointing to the Write-Log-Class.psm1 file, please note using statements must be the very first lines of your script. In this example the Write-Log folder containing the file is in the root folder with the script calling it.
55
+
4. Add the Using statement pointing to the Write-Log-Class.psm1 file, please note using statements must be the very first lines of your script. In this example the Write-Log folder containing the file is in the root folder with the script calling it.
56
+
55
57
```ps1
56
58
using module ".\Write-Log\Write-Log-Class.psm1"
57
59
```
58
-
4. See <ahref="#usage-of-the-class-version">Class Version Usage</a> section for examples on how to configure the log location and add enteries.
60
+
61
+
1. See <ahref="#usage-of-the-class-version">Class Version Usage</a> section for examples on how to configure the log location and add entries.
59
62
60
63
### Installation of Module Version
61
64
62
-
1. Download the <ahref="https://github.com/captainqwerty/Write-Log/releases">latest release</a>.
65
+
1. Download the <ahref="https://github.com/PowershellGroup/Write-Log-Module/releases">latest release</a>.
63
66
2. Extra the zipped folder.
64
67
3. Ensure the Write-log.psm1 remains in a folder called "Write-Log" and place the Write-Log folder in your project's folder or in a location the script can access under the context it will be ran.
65
-
4. Import the Module. In this example the Write-Log folder is in the root of the project folder.
68
+
4. Import the Module. In this example the Write-Log folder is in the root of the project folder.
69
+
66
70
```ps1
67
-
$module = "$psscriptroot\Write-Log"
71
+
$module = "$PSScriptRoot\Write-Log"
68
72
if(!(test-path $module)){
69
73
write-host "$module not found" -ForegroundColor Red
70
74
exit
71
75
}
72
76
Import-Module $module
73
77
```
74
-
4. See <ahref="#usage-of-the-module-version">Module Version Usage</a> section for examples on how to configure the log location and add enteries.
75
-
5. Add the Remove-Module line to the bottom of your script.
78
+
79
+
1. See <ahref="#usage-of-the-module-version">Module Version Usage</a> section for examples on how to configure the log location and add entries.
80
+
2. Add the Remove-Module line to the bottom of your script.
81
+
76
82
```ps1
77
83
Remove-Module Write-Log
78
84
```
@@ -81,17 +87,19 @@ Remove-Module Write-Log
81
87
82
88
<!-- USAGE EXAMPLES -->
83
89
## Usage of the Class Version
90
+
84
91
```ps1
85
92
using module ".\Class\Write-Log\Write-Log-Class.psm1"
86
93
87
94
$Log = [WriteLog]::New("C:\Example\mylog.log")
88
95
89
-
$Log.AddInfo("Something occured that was wroth making an info log about")
96
+
$Log.AddInfo("Something occurred that was worth making an info log about")
90
97
$Log.AddError("There was a huge error!")
91
-
$Log.AddWarning("Oh dear I should really warn you about this!")
98
+
$Log.AddWarning("Oh dear, I should really warn you about this!")
92
99
$Log.AddEntry("Testing","Test Severity") #This method is hidden but can be used for custom severities
93
100
```
94
-
The below example shows having mutliple Write-Log objects to store different types or log enteries in different logs.
101
+
102
+
The below example shows having multiple Write-Log objects to store different types or log entries in different logs.
95
103
96
104
```ps1
97
105
using module ".\Class\Write-Log\Write-Log-Class.psm1"
0 commit comments