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
Copy file name to clipboardExpand all lines: README.md
+11-21Lines changed: 11 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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 preferred version however this version is limited to PowerShell Version 5.0 and greater and utilizes the *Using* statement.
29
+
The class Version is the preferred version however this version is limited to PowerShell Version 5.0 and greater and utilises the *Using* statement.
30
30
31
31
### Module Version
32
32
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.
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.
34
34
35
35
<palign="right">(<ahref="#top">back to top</a>)</p>
36
36
@@ -43,7 +43,6 @@ 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
-
47
46
* PowerShell version 2.0 or greater - Module Version.
48
47
* PowerShell version 5.0 or greater - Either version.
49
48
@@ -52,21 +51,18 @@ This is an example of how to list things you need to use the software and how to
52
51
1. Download the <ahref="https://github.com/PowershellGroup/Write-Log-Module/release">latest release</a>.
53
52
2. Extract the zipped folder.
54
53
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.
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
-
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.
57
55
```ps1
58
56
using module ".\Write-Log\Write-Log-Class.psm1"
59
57
```
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.
58
+
5. See <ahref="#usage-of-the-class-version">Class Version Usage</a> section for examples on how to configure the log location and add enteries.
62
59
63
60
### Installation of Module Version
64
61
65
62
1. Download the <ahref="https://github.com/PowershellGroup/Write-Log-Module/releases">latest release</a>.
66
63
2. Extra the zipped folder.
67
64
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.
68
-
4. Import the Module. In this example the Write-Log folder is in the root of the project folder.
69
-
65
+
4. Import the Module. In this example the Write-Log folder is in the root of the project folder.
70
66
```ps1
71
67
$module = "$PSScriptRoot\Write-Log"
72
68
if(!(test-path $module)){
@@ -75,10 +71,8 @@ if(!(test-path $module)){
75
71
}
76
72
Import-Module $module
77
73
```
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
-
74
+
5. 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
+
6. Add the Remove-Module line to the bottom of your script.
82
76
```ps1
83
77
Remove-Module Write-Log
84
78
```
@@ -87,7 +81,6 @@ Remove-Module Write-Log
87
81
88
82
<!-- USAGE EXAMPLES -->
89
83
## Usage of the Class Version
90
-
91
84
```ps1
92
85
using module ".\Class\Write-Log\Write-Log-Class.psm1"
93
86
@@ -98,8 +91,7 @@ $Log.AddError("There was a huge error!")
98
91
$Log.AddWarning("Oh dear, I should really warn you about this!")
99
92
$Log.AddEntry("Testing","Test Severity") #This method is hidden but can be used for custom severities
100
93
```
101
-
102
-
The below example shows having multiple Write-Log objects to store different types or log entries in different logs.
94
+
The below example shows having mutliple Write-Log objects to store different types or log enteries in different logs.
103
95
104
96
```ps1
105
97
using module ".\Class\Write-Log\Write-Log-Class.psm1"
@@ -114,7 +106,6 @@ $WarningLog.AddWarning("Oh dear, I should really warn you about this!")
114
106
```
115
107
116
108
## Usage of the Module version
117
-
118
109
```ps1
119
110
$module = "$PSScriptRoot\Module\Write-Log"
120
111
if(!(test-path $module)){
@@ -131,9 +122,7 @@ write-log "This is an example Warning" -severity "Warning" -logLocation $logLoca
131
122
132
123
Remove-Module Write-Log
133
124
```
134
-
135
-
Below is an example of having separate logs for Info, Error and Warning entries.
136
-
125
+
Below is an example of having seperate logs for Info, Error and Warning enteries.
137
126
```ps1
138
127
$module = "$PSScriptRoot\Module\Write-Log"
139
128
if(!(test-path $module)){
@@ -152,7 +141,6 @@ write-log "This is an example Warning" -severity "Warning" -logLocation $Warning
152
141
153
142
Remove-Module Write-Log
154
143
```
155
-
156
144
<palign="right">(<ahref="#top">back to top</a>)</p>
157
145
158
146
<!-- CONTRIBUTING -->
@@ -175,6 +163,8 @@ Don't forget to give the project a star! Thanks again!
*[matthewjdegarmo](https://github.com/matthewjdegarmo) - Excellent suggestion on moving from ValidationSet in the module version and improvements / corrections to the ReadMe
167
+
*[SeidChr](https://github.com/SeidChr) - For prompting the addition of .txt
178
168
179
169
<palign="right">(<ahref="#top">back to top</a>)</p>
0 commit comments