Skip to content

Commit f98a066

Browse files
committed
Log module: Write-host replaced
1 parent 55705f3 commit f98a066

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

PSLog/PSLog.psd1

+21-19
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
@{
2-
RootModule = 'PSLog.psm1'
2+
RootModule = 'PSLog.psm1'
33

4-
ModuleVersion = '1.0.0'
4+
ModuleVersion = '1.0.0'
55

66
CompatiblePSEditions = 'Core', 'Desktop'
77

8-
GUID = 'cd303a6c-f405-4dcb-b1ce-fbc2c52264e9'
8+
GUID = 'cd303a6c-f405-4dcb-b1ce-fbc2c52264e9'
99

10-
Author = 'Raimund Andree, Per Pedersen'
10+
Author = 'Raimund Andree, Per Pedersen'
1111

12-
Description = 'Redirects stanard Write-* cmdlets to a log and offers some basic tracing functions'
12+
Description = 'Redirects stanard Write-* cmdlets to a log and offers some basic tracing functions'
1313

14-
CompanyName = 'AutomatedLab Team'
14+
CompanyName = 'AutomatedLab Team'
1515

16-
Copyright = '2019'
16+
Copyright = '2019'
1717

18-
PowerShellVersion = '5.1'
18+
PowerShellVersion = '5.1'
1919

20-
DotNetFrameworkVersion = '3.5'
20+
DotNetFrameworkVersion = '3.5'
2121

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

PSLog/PSLog.psm1

+4-4
Original file line numberDiff line numberDiff line change
@@ -564,22 +564,22 @@ function Write-ScreenInfo
564564
}
565565
Info
566566
{
567-
$Message | ForEach-Object { Microsoft.PowerShell.Utility\Write-Host $_ }
567+
$Message | ForEach-Object { Write-PSFMessage -Level Host $_ }
568568
$Global:PSLog_NoNewLine = $false
569569
}
570570
Verbose
571571
{
572572
if ($VerbosePreference -eq 'Continue')
573573
{
574-
$Message | ForEach-Object { Microsoft.PowerShell.Utility\Write-Host $_ -ForegroundColor Cyan }
574+
$Message | ForEach-Object { Microsoft.PowerShell.Utility\Write-Host $_ -ForegroundColor Cyan }
575575
$Global:PSLog_NoNewLine = $false
576576
}
577577
}
578578
Debug
579579
{
580580
if ($DebugPreference -eq 'Continue')
581581
{
582-
$Message | ForEach-Object { Microsoft.PowerShell.Utility\Write-Host $_ -ForegroundColor Cyan }
582+
$Message | ForEach-Object { Microsoft.PowerShell.Utility\Write-Host $_ -ForegroundColor Cyan }
583583
$Global:PSLog_NoNewLine = $false
584584
}
585585
}
@@ -601,7 +601,7 @@ function Write-ScreenInfo
601601
}
602602
Info
603603
{
604-
$Message | ForEach-Object { Microsoft.PowerShell.Utility\Write-Host "$timeCurrent|$timeDeltaString|$timeDeltaString2| $_" }
604+
$Message | ForEach-Object { Write-PSFMessage -Level Host "$timeCurrent|$timeDeltaString|$timeDeltaString2| $_" }
605605
}
606606
Debug
607607
{

0 commit comments

Comments
 (0)