Skip to content

Commit c691ffb

Browse files
committed
Added Convert-LovibondToSrm function.
1 parent 9f85f6e commit c691ffb

File tree

3 files changed

+95
-12
lines changed

3 files changed

+95
-12
lines changed

Functions/Convert-LovibondToSrm.ps1

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<#PSScriptInfo
2+
3+
.Version
4+
1.0
5+
.Guid
6+
bf215750-33c6-473e-8562-fbbd52d2e124
7+
.Author
8+
Thomas Malkewitz @dotps1
9+
.Tags
10+
Lovibond, SRM
11+
.ProjectUri
12+
https://github.com/dotps1/PSFunctions
13+
.ReleaseNotes
14+
Initial Release.
15+
16+
#>
17+
18+
<#
19+
20+
.Synopsis
21+
Converts Lovibond to SRM.
22+
.Description
23+
Converts lovibond to SRM.
24+
.Inputs
25+
System.Double
26+
.Outputs
27+
System.Double
28+
.Parameter Lovibond
29+
System.Double
30+
The Lovibond value to convert
31+
.Example
32+
PS C:\> Convert-LovibondToSrm -Lovibond 3.5
33+
3.98
34+
.Notes
35+
SRM = (1.3546 × °L) - 0.76
36+
.Link
37+
https://dotps1.github.io
38+
.Link
39+
https://www.brewtoad.com/tools/color-converter
40+
.Link
41+
https://grposh.github.io
42+
43+
#>
44+
45+
46+
[CmdletBinding()]
47+
[OutputType(
48+
[Double]
49+
)]
50+
51+
param (
52+
[Parameter(
53+
Mandatory = $true,
54+
ValueFromPipeline = $true,
55+
ValueFromPipelineByPropertyName = $true
56+
)]
57+
[Double[]]
58+
$Lovibond
59+
)
60+
61+
process {
62+
foreach ($lovibondValue in $Lovibond) {
63+
try {
64+
$srm = ( 1.3546 * $lovibondValue ) - .76
65+
66+
Write-Output -InputObject ( [Math]::Round( $srm, 2 ))
67+
} catch {
68+
$PSCmdlet.WriteError(
69+
$_
70+
)
71+
}
72+
}
73+
}

Functions/Get-ApplockerWinEvent.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.Author
88
Thomas J. Malkewitz @dotps1
99
.Tags
10-
Applocker, WinEvent
10+
AppLocker, WinEvent
1111
.ProjectUri
1212
https://github.com/dotps1/PSFunctions
1313
@@ -16,19 +16,19 @@
1616
<#
1717
1818
.Synopsis
19-
Gets Applocker related events.
19+
Gets AppLocker related events.
2020
.Description
21-
Gets Applocker events based on given critera from the local or remote machine(s).
21+
Gets AppLocker events based on given critera from the local or remote machine(s).
2222
.Inputs
2323
System.String
2424
.Outputs
2525
System.Diagnostics.Eventing.Reader.EventLogRecord
2626
.Parameter Name
2727
System.String
28-
The name of the system to get Applocker data against.
28+
The name of the system to get AppLocker data against.
2929
.Parameter EventType
3030
System.String
31-
The type of Applocker events to get, the default value is all events from the Microsoft-Windows-AppLocker log provider.
31+
The type of AppLocker events to get, the default value is all events from the Microsoft-Windows-AppLocker log provider.
3232
.Parameter LogName
3333
System.String
3434
The specific log to pull events from, the default value is all logs from the Microsoft-Windows-AppLocker log provider.
@@ -48,7 +48,7 @@
4848
System.DateTime
4949
The ending range to get EventLogRecord objects from.
5050
.Example
51-
PS C:\> Get-ApplockerWinEvent -MaxEvents 2
51+
PS C:\> Get-AppLockerWinEvent -MaxEvents 2
5252
5353
5454
ProviderName: Microsoft-Windows-AppLocker
@@ -58,7 +58,7 @@
5858
10/5/2017 8:17:59 AM 8005 Information %OSDRIVE%\USERS\dotps1\DOCUMENTS\GITHUB\PSFUNCTIONS\FUNCTIONS\GET-APPLOCKERWINEVENT.PS1 was allowed to run.
5959
10/5/2017 8:15:10 AM 8002 Information %PROGRAMFILES%\GIT\MINGW64\BIN\GIT.EXE was allowed to run.
6060
.Example
61-
PS C:\> Get-ApplockerWinEvent -MaxEvents 2 -Oldest -LogName ExeAndDll -Credential (Get-Credential) -ComputerName myremotebox
61+
PS C:\> Get-AppLockerWinEvent -MaxEvents 2 -Oldest -LogName ExeAndDll -Credential (Get-Credential) -ComputerName myremotebox
6262
6363
6464
ProviderName: Microsoft-Windows-AppLocker
@@ -73,7 +73,7 @@
7373
.Link
7474
https://dotps1.github.io
7575
.Link
76-
https://www.powershellgallery.com/packages/Get-ApplockerWinEvent
76+
https://www.powershellgallery.com/packages/Get-AppLockerWinEvent
7777
.Link
7878
https://grposh.github.io
7979

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ So they are contained in single .ps1 files that can be installed using `Install-
88

99
---
1010

11+
### Convert-LovibondToSrm
12+
Converts the Lovibond color value of malt to its respective SRM value.
13+
14+
```
15+
PS C:\> Convert-LovibondToSrm -Lovibond 3.5
16+
3.98
17+
```
18+
19+
---
20+
1121
### ConvertTo-ShortPath
1222
Converts each element of a file object path to the 8.3 path and return the short path string.
1323

@@ -74,11 +84,11 @@ MyComputer Default-First-Site
7484

7585
---
7686

77-
### Get-ApplockerWinEvent
78-
Gets Applocker events based on given critera from the local or remote machine(s).
87+
### Get-AppLockerWinEvent
88+
Gets AppLocker events based on given critera from the local or remote machine(s).
7989

8090
```
81-
PS C:\> Get-ApplockerWinEvent -MaxEvents 2
91+
PS C:\> Get-AppLockerWinEvent -MaxEvents 2
8292
8393
8494
ProviderName: Microsoft-Windows-AppLocker
@@ -89,7 +99,7 @@ TimeCreated Id LevelDisplayName Message
8999
10/5/2017 8:15:10 AM 8002 Information %PROGRAMFILES%\GIT\MINGW64\BIN\GIT.EXE was allowed to run.
90100
91101
92-
PS C:\> Get-ApplockerWinEvent -MaxEvents 2 -Oldest -LogName ExeAndDll -Credential (Get-Credential) -ComputerName myremotebox
102+
PS C:\> Get-AppLockerWinEvent -MaxEvents 2 -Oldest -LogName ExeAndDll -Credential (Get-Credential) -ComputerName myremotebox
93103
94104
95105
ProviderName: Microsoft-Windows-AppLocker

0 commit comments

Comments
 (0)