Resources/Module/src/Module/Private/Get-Day.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
<#
.SYNOPSIS
    Short description
.DESCRIPTION
    Long description
.EXAMPLE
    C:\PS>
    Example of how to use this cmdlet
.EXAMPLE
    C:\PS>
    Another example of how to use this cmdlet
.PARAMETER InputObject
    Specifies the object to be processed. You can also pipe the objects to this command.
.OUTPUTS
    Output from this cmdlet (if any)
.NOTES
    General notes
.COMPONENT
    <%=$PLASTER_PARAM_ModuleName%>
#>

function Get-Day {
    [CmdletBinding()]
    param (
        # [Parameter(Mandatory = $true,
        # HelpMessage = 'Helpful Message')]
        # [ValidateNotNull()]
        # [ValidateNotNullOrEmpty()]
        # [string]$YourParameter
    )
    try {
        $day = (Get-Date -ErrorAction 'Stop').DayOfWeek
    }
    catch {
        $day = 'Unknown'
    }

    return $day
} #Get-Day