OneGet/Get-DynamicOptions.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

function Get-DynamicOptions {
    param (
        [Microsoft.PackageManagement.MetaProvider.PowerShell.OptionCategory] 
        $category
    )

    Write-Debug ($LocalizedData.ProviderDebugMessage -f ('Get-DynamicOptions'))

    switch ($category) {
        Package {
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:prerelease -ExpectedType Switch -IsRequired $false)

            # TODO: add support for: timeout, proxy, approved-only, not-broken
        }
        Install {
            #Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:additionalArguments -ExpectedType String -IsRequired $false)

            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:prerelease -ExpectedType Switch -IsRequired $false)
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:packageParameters -ExpectedType String -IsRequired $false)
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:ignoreDependencies -ExpectedType Switch -IsRequired $false)
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:forceDependencies -ExpectedType Switch -IsRequired $false)
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:skipPowershell -ExpectedType Switch -IsRequired $false)
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:cacheLocation -ExpectedType String -IsRequired $false)

            # special option for passing switches from the PackageManagement DSC-resource
            Write-Output -InputObject (New-DynamicOption -Category $category -Name $script:switches -ExpectedType String -IsRequired $false)

            # TODO: add support for: timeout, proxy, approved-only, not-broken
            # TODO: add support for: install-arguments
        }
    }
}