Skip to content

Commit 62bea22

Browse files
Tim KrehanTim Krehan
authored andcommitted
updated readme
1 parent ddfbe83 commit 62bea22

File tree

1 file changed

+46
-21
lines changed

1 file changed

+46
-21
lines changed

readme.md

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,59 @@
1-
# Add easy logging to PowerShell!
1+
# Add easy logging to PowerShell
2+
23
## Installation
3-
1. download the latest release from [git-releases](https://git.brz.de/powershell-modules/poshlogging/-/releases)
4+
5+
1. download the latest release from [git-releases](https://github.com/tim-krehan/powershell-logging/releases)
46
2. extract the files
5-
3. open the PowerShell in the new folder
6-
4. execute the following command:
7+
3. Open the Powershell in the extracted Folder
8+
4. Install the module with the following command:
9+
710
``` powershell
8-
$source = ".\export\PoShLogging"
9-
$userModulePath = $env:PSModulePath.split(";") |Where-Object -FilterScript {$_ -like "*$env:USERNAME*Windows*PowerShell*"}
10-
Copy-Item -Path $source -Destination $userModulePath -Force -Recurse
11+
Get-Module ".\export\PoShLogging" -ListAvailable |install-module -Scope CurrentUser
1112
```
13+
1214
## Usage
13-
### Write-Log
15+
16+
### Open-Log
17+
1418
``` powershell
15-
Write-Log INFO "i am a info logline"
16-
```
19+
Open-Log -Name "PowershellLogging" -ShowDebug -LogPath ".\LOG"
1720
```
18-
PS> 2020.12.07 11:58:39.677 - INFO - [email protected] : i am a informational logline
21+
22+
``` txt
23+
Name : PowershellLogging
24+
FullName : C:\Users\tim-krehan\LOG\PowershellLogging.log
25+
Folder : C:\Users\tim-krehan\LOG
26+
LogLevels : {DEBUG, INFO, WARNING, SUCCESS...}
27+
LogLines :
28+
WriteThrough : True
1929
```
20-
### Get-LogConfig
30+
31+
### Write-Log
32+
2133
``` powershell
22-
Get-LogConfig
23-
```
34+
Write-Log INFO information
2435
```
25-
PS>
2636

27-
LogName Location
28-
------- --------
29-
powershell C:\Users\Steve\Desktop
37+
``` txt
38+
2021-01-18 14:38:05.9539 - [email protected] - INFO - information
3039
```
31-
### Set-LogConfig
40+
41+
### Get-Log
42+
3243
``` powershell
33-
Set-LogConfig -Location "C:\Users\Steve\Desktop" -LogName "powershell"
34-
```
44+
Get-Log |Select-Object -ExpandProperty "LogLines"
45+
```
46+
47+
``` txt
48+
DateTime User Domain Severity Message
49+
-------- ---- ------ -------- -------
50+
18.01.2021 14:38:05 b550 baugruppe.de INFO information
51+
```
52+
53+
### Clear-Log
54+
55+
clears the current logfile completly
56+
57+
### Close-Log
58+
59+
disconnects from log (can be opend again with ` Open-Log `)

0 commit comments

Comments
 (0)