Skip to content

Commit

Permalink
Merge pull request #8 from ProVal-Tech/write-log-default
Browse files Browse the repository at this point in the history
Implement Defaults for Write-Log and Add Simple Pester Testing
  • Loading branch information
nixuno authored Apr 25, 2023
2 parents f4ed15e + c33729f commit 75bb715
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Template.ps1
Strapper.db
SQLite.NET.chm
SQLite.NET.chm
SignModule.ps1
23 changes: 23 additions & 0 deletions Strapper.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
BeforeAll {
Import-Module "$PSScriptRoot/Strapper/Strapper.psd1"
}

Describe "Write-Log" {
BeforeEach {
$testGuid = New-Guid
}
It "Writes a database entry" {
$StrapperSession.LogsToDB = $true # default value
Write-Log -Text $testGuid
Get-StrapperLog | Select-Object -ExpandProperty Message -Last 1 | Should -Be $testGuid
}
It "Writes a log file entry" {
Write-Log -Text $testGuid
Get-Content -Path $StrapperSession.LogPath | Select-Object -Last 1 | Should -Match "$testGuid$"
}
It "Does not write a database entry if not enabled" {
$StrapperSession.LogsToDB = $false
Write-Log -Text $testGuid
Get-StrapperLog | Select-Object -ExpandProperty Message -Last 1 | Should -Not -Be $testGuid
}
}
63 changes: 30 additions & 33 deletions Strapper/Public/Write-Log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ function Write-Log {
#>
[CmdletBinding(DefaultParameterSetName = 'Level')]
param (
[Parameter(Mandatory, ParameterSetName = 'Type')]
[Parameter(Mandatory, ParameterSetName = 'Level')]
[AllowEmptyString()]
[Alias('Message')]
[Parameter(Mandatory, Position = 0)][AllowEmptyString()][Alias('Message')]
[string]$Text,
[Parameter(Mandatory, DontShow, ParameterSetName = 'Type')]
[string]$Type,
[Parameter(Mandatory, ParameterSetName = 'Level')]
[Parameter(ParameterSetName = 'Level')]
[ValidateSet('Verbose', 'Debug', 'Information', 'Warning', 'Error', 'Fatal')]
[string]$Level,
[string]$Level = 'Information',
[Parameter()]
[System.Exception]$Exception,
[Parameter()]
Expand All @@ -41,7 +38,7 @@ function Write-Log {
}

# Accounting for -Type to allow for backwards compatibility.
if (!$Level) {
if ($Type) {
switch ($Type) {
'LOG' { $Level = [StrapperLogLevel]::Information }
'WARN' { $Level = [StrapperLogLevel]::Warning }
Expand Down Expand Up @@ -112,8 +109,8 @@ function Write-Log {
# SIG # Begin signature block
# MIInbwYJKoZIhvcNAQcCoIInYDCCJ1wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA/4/RSxWyHDeu3
# CtTD9XYu1Gh+pihU6Hyg3uEt+Ue1gaCCILYwggXYMIIEwKADAgECAhEA5CcElfaM
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDaFLjVbONLe/Ku
# bqJ4VWXliGGPAlJfiKl95AhO1LGMqqCCILYwggXYMIIEwKADAgECAhEA5CcElfaM
# kdbQ7HtJTqTfHDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJQTDEiMCAGA1UE
# ChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl
# cnRpZmljYXRpb24gQXV0aG9yaXR5MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBO
Expand Down Expand Up @@ -293,32 +290,32 @@ function Write-Log {
# LmNvbSBDb2RlIFNpZ25pbmcgSW50ZXJtZWRpYXRlIENBIFJTQSBSMQIQeVwkxuz4
# snsBAPX7/vbayDANBglghkgBZQMEAgEFAKCBhDAYBgorBgEEAYI3AgEMMQowCKAC
# gAChAoAAMBkGCSqGSIb3DQEJAzEMBgorBgEEAYI3AgEEMBwGCisGAQQBgjcCA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
# vX12cjBO6FC7IDiOSvwSNvwousqbEI6+wCKxPELFHNszl+5isRpTUZOPEJspkGCm
# bzKZ/zMzWwFTRrxtBSGjobUzcDJJ1F0NySpcsCeonR87SZi0Quy71GSwaJX4/q7I
# D7f++MInHH52MWKVKVxOD3Q7Mg==
# SIG # End signature block
54 changes: 27 additions & 27 deletions Strapper/Strapper.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'Strapper.psm1'

# Version number of this module.
ModuleVersion = '1.4.5'
ModuleVersion = '1.5.1'

# ID used to uniquely identify this module
GUID = '6fe5cf06-7b4f-4695-b022-1ca2feb0341f'
Expand Down Expand Up @@ -95,8 +95,8 @@ PrivateData = @{
# SIG # Begin signature block
# MIInbwYJKoZIhvcNAQcCoIInYDCCJ1wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCfn5C+jahZJMr8
# VYoj4eHylgA+S9La9unJH2dENaVcT6CCILYwggXYMIIEwKADAgECAhEA5CcElfaM
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA0lp7pM8zojs2K
# Auf+Xf9UckLKbqAxKWI2EfQU8K40cqCCILYwggXYMIIEwKADAgECAhEA5CcElfaM
# kdbQ7HtJTqTfHDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJQTDEiMCAGA1UE
# ChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl
# cnRpZmljYXRpb24gQXV0aG9yaXR5MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBO
Expand Down Expand Up @@ -276,32 +276,32 @@ PrivateData = @{
# LmNvbSBDb2RlIFNpZ25pbmcgSW50ZXJtZWRpYXRlIENBIFJTQS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a3Fxj3IU7cw+VmGeWvhE3pnvSx1h0NfXFRGGynjVNsmf6EuM5UlvGjzb
# AVSi/9y24QGx7IYogA+OcMfrbYkZFezfRKQPBYyKlwK79PrPUxEfZC1PnqX+cxOR
# mpHa9WBApxMGv3ppEgzjd4xI0LMgKcHzarci0BTHYSp7L9wu6RgrgrarTlB0d94u
# 8J+ynQ6/D3A6bphMBATnByE7wzxOtZrq9fM6XoQb3M1YIznWgdYAXt3IgP4E1vEQ
# kf8fXrkadMBmVBLJe1dZ+STgrA==
# SIG # End signature block
71 changes: 39 additions & 32 deletions Strapper/Strapper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $StrapperSession = [pscustomobject]@{
IsElevated = $false
LogsToDB = $true
LogTable = $null
DBPath = "$PSScriptRoot\Strapper.db"
DBPath = "$PSScriptRoot/Strapper.db"
Platform = [System.Environment]::OSVersion.Platform
}

Expand Down Expand Up @@ -38,15 +38,15 @@ if ($StrapperSession.Platform -eq 'Win32NT') {
}

$enums = @(@(
"$PSScriptRoot\enums\StrapperLogLevel.ps1"
"$PSScriptRoot/Enums/StrapperLogLevel.ps1"
) | Get-ChildItem)

$classes = @(@(
"$PSScriptRoot\classes\StrapperLog.ps1"
"$PSScriptRoot/Classes/StrapperLog.ps1"
) | Get-ChildItem)

$publicFunctions = @( Get-ChildItem -Path "$PSScriptRoot\Public\*.ps1" -Recurse )
$privateFunctions = @( Get-ChildItem -Path "$PSScriptRoot\Private\*.ps1" -Recurse )
$publicFunctions = @( Get-ChildItem -Path "$PSScriptRoot/Public/*.ps1" -Recurse )
$privateFunctions = @( Get-ChildItem -Path "$PSScriptRoot/Private/*.ps1" -Recurse )
foreach ($importTarget in @($enums + $classes + $publicFunctions + $privateFunctions)) {
try {
. $importTarget.FullName
Expand All @@ -58,14 +58,21 @@ foreach ($importTarget in @($enums + $classes + $publicFunctions + $privateFunct
if(!(Test-Path -LiteralPath $StrapperSession.DBPath)) {
[System.Data.SQLite.SQLiteConnection]::CreateFile($StrapperSession.DBPath)
}

if($IsLinux -or $IsMacOS) {
chmod 776 $StrapperSession.DBPath
} else {
$dbPathAcl = Get-Acl -Path $StrapperSession.DBPath
$fsar = [System.Security.AccessControl.FileSystemAccessRule]::new("Everyone", "FullControl", "Allow")
$dbPathAcl.SetAccessRule($fsar)
Set-Acl -Path $StrapperSession.DBPath -AclObject $dbPathAcl
}
Export-ModuleMember -Variable StrapperSession

# SIG # Begin signature block
# MIInbwYJKoZIhvcNAQcCoIInYDCCJ1wCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCNJ353oCya4Eq6
# K3Q7oF45yQEzIG/VdpLXf+goXnHS8aCCILYwggXYMIIEwKADAgECAhEA5CcElfaM
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCwpesIeDlmBdwe
# HoTik5RhH0hDm1TnF5OrqFSJMcQz5qCCILYwggXYMIIEwKADAgECAhEA5CcElfaM
# kdbQ7HtJTqTfHDANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJQTDEiMCAGA1UE
# ChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl
# cnRpZmljYXRpb24gQXV0aG9yaXR5MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBO
Expand Down Expand Up @@ -245,32 +252,32 @@ Export-ModuleMember -Variable StrapperSession
# LmNvbSBDb2RlIFNpZ25pbmcgSW50ZXJtZWRpYXRlIENBIFJTQSBSMQIQeVwkxuz4
# snsBAPX7/vbayDANBglghkgBZQMEAgEFAKCBhDAYBgorBgEEAYI3AgEMMQowCKAC
# gAChAoAAMBkGCSqGSIb3DQEJAzEMBgorBgEEAYI3AgEEMBwGCisGAQQBgjcC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7O1B1ZF0ruZoH71N02bmf2GS/EzKENUL4r1i
# wzkY0iYDXj6ipF7N9ixqzzIWFJwJVavuThEhjOn0NezyRDtkOK8i785usG/mvydp
# I4eRtTLhrgoZdCqxh1GbXXwwSw==
# SIG # End signature block

0 comments on commit 75bb715

Please sign in to comment.