Public/New-bConnectApplicationInstallOptions.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
Function New-bConnectApplicationInstallOptions() {
    <#
        .Synopsis
            Creates a new InstallApplicationOption for Applications.
            Empty or filled with given information.
        .Parameter RebootBehaviour
            Reboot behaviour after installation
        .Parameter AllowReinstall
            If set, reinstallation is allowed
        .Parameter UseBbt
            If set, bBT is supported
        .Parameter VisibleExecution
            Shows in which cases the execution of this software is visible
        .Parameter CopyLocally
            If set, installation files should be copied to local filesystem
        .Parameter DisableInputDevices
            If set, no input devices will be available during installation
        .Parameter DontSetAsInstalled
            If set, this application shouldn’t be shown as installed, after installation
        .Parameter Target
            Target path variable
        .Outputs
            InstallApplicationOption (see bConnect documentation for more details)
    #>


    [OutputType("System.Management.Automations.PSObject")]
    Param(
        [ValidateSet("NoReboot","Reboot","AppReboot","DeferrableReboot",ignoreCase=$true)][string]$RebootBehaviour = "NoReboot",
        [switch]$AllowReinstall = $true,
        [switch]$UsebBT,
        [ValidateSet("Silent","NeedsDesktop","VisibleWhenUserLoggedOn",ignoreCase=$true)][string]$VisibleExecution = "Silent",
        [switch]$CopyLocally,
        [switch]$DisableInputDevices,
        [switch]$DontSetAsInstalled,
        [string]$Target
    )

    $_new_installationOption = @{
        RebootBehaviour = $RebootBehaviour;
        AllowReinstall = $AllowReinstall;
        UsebBT = $UsebBT;
        VisibleExecution = $VisibleExecution;
        CopyLocally = $CopyLocally;
        DisableInputDevices = $DisableInputDevices;
        DontSetAsInstalled = $DontSetAsInstalled;
        MapShare = $false;
        Target = $Target;
    }

    return $_new_installationOption
}