resources/templates/NewScript/parts/Script.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# using module .\.\Get-ScriptFile.ps1

function <%=$PLASTER_PARAM_ScriptName%>
{
    [CmdletBinding(DefaultParameterSetName = "ParameterSetName",
        # ConfirmImpact = <String>,
        # HelpURI = <URI>,
        # SupportsPaging = $false,
        # SupportsShouldProcess = $false,
        PositionalBinding = $true)]
    [OutputType([string], ParameterSetName = "ParameterSetName")]
    Param(
        # Specifies a path to one or more locations. Wildcards are permitted.
        [Parameter(Mandatory = $true,
            ParameterSetName = "ParameterSetName",
            # ValueFromPipeline = $true,
            # ValueFromPipelineByPropertyName = $true,
            #HelpMessage = "Path to one or more locations.",
            Position = 0)]
        # [AllowNull()]
        # [AllowEmptyString()]
        # [AllowEmptyCollection()]
        # [ValidateCount(1, 5)]
        # [ValidateLength(1, 10)]
        # [ValidatePattern("[0-9][0-9][0-9][0-9]")]
        # [ValidateRange(0, 10)]
        # [ValidateScript( {$_ -ge (Get-Date)})]
        # [ValidateSet("Low", "Average", "High")]
        [ValidateNotNull()]
        # [ValidateNotNullOrEmpty()]
        # [ValidateDrive("C", "D", "Variable", "Function")]
        # [ValidateUserDrive()]
        [string[]]
        $Path

        # [Switch]
        # $Confirm
    )
    <#
    DynamicParam {
        if ($path -match ".HKLM.:") {
            $attributes = New-Object -Type `
                System.Management.Automation.ParameterAttribute
            $attributes.ParameterSetName = "__AllParameterSets"
            $attributes.Mandatory = $false
            $attributeCollection = New-Object `
                -Type System.Collections.ObjectModel.Collection[System.Attribute]
            $attributeCollection.Add($attributes)
 
            $dynParam1 = New-Object -Type `
                System.Management.Automation.RuntimeDefinedParameter("dp1", [Int32],
                $attributeCollection)
 
            $paramDictionary = New-Object `
                -Type System.Management.Automation.RuntimeDefinedParameterDictionary
            $paramDictionary.Add("dp1", $dynParam1)
            return $paramDictionary
        }
    }
    #>

    begin {
    }
    
    process {
    }
    
    end {
        Write-Error "The following file has only been scaffold and not implemented: '$PSCommandPath'" -Category NotImplemented
    }
}