functions/message/Get-PSFMessage.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function Get-PSFMessage
{
<#
    .SYNOPSIS
        Returns log entries for the PSFramework
     
    .DESCRIPTION
        Returns log entries for the PSFramework. Handy when debugging or developing a script using it.
     
    .PARAMETER Errors
        Instead of log entries, the error entries will be retrieved
     
    .EXAMPLE
        Get-PSFMessage
         
        Returns all log entries currently in memory.
#>

    [CmdletBinding()]
    param
    (
        [switch]
        $Errors
    )
    
    BEGIN
    {
        
    }
    
    PROCESS
    {
        if ($Errors) { return [PSFramework.Message.LogHost]::GetErrors() }
        else { return [PSFramework.Message.LogHost]::GetLog() }
    }
    
    END
    {
        
    }
}