Skip to content

Commit 4bb6a6b

Browse files
committed
Reverting back to version before adding settings.ps1 file.
1 parent 41e7f64 commit 4bb6a6b

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

AutomatedLab/settings.psd1

-11
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@
3737
}
3838
}
3939
)
40-
Logging = @{
41-
TruncateLength = 50
42-
TruncateTypes = @(
43-
'System.Management.Automation.ScriptBlock'
44-
)
45-
DefaultFolder = $null
46-
DefaultName = 'PSLog'
47-
Level = 'All'
48-
Silent = $false
49-
AutoStart = $true
50-
}
5140
MachineFileName = 'Machines.xml'
5241
DiskFileName = 'Disks.xml'
5342
LabFileName = 'Lab.xml'

PSLog/PSLog.psd1

+11-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,15 @@
1919

2020
ModuleList = @('PSLog')
2121

22-
PrivateData = @{ }
22+
PrivateData = @{
23+
AutoStart = $true
24+
DefaultFolder = $null
25+
DefaultName = 'PSLog'
26+
Level = 'All'
27+
Silent = $false
28+
TruncateTypes = @(
29+
'System.Management.Automation.ScriptBlock'
30+
)
31+
TruncateLength = 50
32+
}
2333
}

PSLog/PSLog.psm1

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Start-Log
3131

3232
if ($UseDefaults)
3333
{
34-
$script:defaults = Get-LabConfigurationItem -Name Logging
34+
$script:defaults = $MyInvocation.MyCommand.Module.PrivateData
3535
if (-not $defaults.DefaultFolder)
3636
{
3737
$LogPath = [Environment]::GetFolderPath('MyDocuments')
@@ -207,7 +207,7 @@ function Write-LogFunctionEntry
207207

208208
if (!$Log)
209209
{
210-
if ($(Get-LabConfigurationItem -Name Logging).AutoStart)
210+
if ($MyInvocation.MyCommand.Module.PrivateData.AutoStart)
211211
{
212212
Write-Verbose 'starting log'
213213
Start-Log -UseDefaults
@@ -310,7 +310,7 @@ function Write-LogFunctionExit
310310

311311
if (!$Log)
312312
{
313-
if ($(Get-LabConfigurationItem -Name Logging).AutoStart)
313+
if ($MyInvocation.MyCommand.Module.PrivateData.AutoStart)
314314
{
315315
Start-Log -UseDefaults
316316
}
@@ -381,7 +381,7 @@ function Write-LogFunctionExitWithError
381381

382382
if (!$Log)
383383
{
384-
if ($(Get-LabConfigurationItem -Name Logging).AutoStart)
384+
if ($MyInvocation.MyCommand.Module.PrivateData.AutoStart)
385385
{
386386
Start-Log -UseDefaults
387387
}
@@ -467,7 +467,7 @@ function Write-LogError
467467

468468
if (!$Log)
469469
{
470-
if ($(Get-LabConfigurationItem -Name Logging).AutoStart)
470+
if ($MyInvocation.MyCommand.Module.PrivateData.AutoStart)
471471
{
472472
Start-Log -UseDefaults
473473
}

0 commit comments

Comments
 (0)