Public/Get-JordanQuote.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
<#
.SYNOPSIS
    A short one-line action-based description, e.g. 'Tests if a function is valid'
.DESCRIPTION
    A longer description of the function, its purpose, common use cases, etc.
.NOTES
    Information or caveats about the function e.g. 'This function is not supported in Linux'
.LINK
    Specify a URI to a help page, this will show when Get-Help -Online is used.
.EXAMPLE
    Test-MyTestFunction -Verbose
 
    Explanation of the function or its result. You can include multiple examples with additional .EXAMPLE lines
.PARAMETER foo
    A specific quote
#>

function Get-JordanQuote {
    param (
        [int]
        $foo
    )
    $quotes = @(
        'Hello',
        'Andrew'
    )
    if ($foo){
        $quote = $quotes[$foo]
    }
    else {
        $quote = $quotes[(Get-Random -Maximum $quotes.Count)]
    }
    return $quote

}