functions/New-DBOConfig.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
function New-DBOConfig {
    <#
    .SYNOPSIS
    Returns a new DBOpsConfig object
     
    .DESCRIPTION
    Returns a newly created DBOpsConfig object with default values.
    Values can be checked and modified using Get/Set-DBODefaultSetting commands.
         
    .PARAMETER Configuration
    Overrides for the configuration values. Will replace default configuration values.
 
    .PARAMETER Confirm
    Prompts to confirm certain actions
 
    .PARAMETER WhatIf
    Shows what would happen if the command would execute, but does not actually perform the command
 
    .EXAMPLE
    # Returns new default configuration
    New-DBOConfig
     
    .EXAMPLE
    # Returns configuration overriding ConnectionTimeout
    New-DBOConfig -Configuration @{ ConnectionTimeout = 5 }
 
    .EXAMPLE
    # Saves empty configuration to a file
    New-DBOConfig | Export-DBOConfig c:\package\dbops.config.json
 
    #>

    [CmdletBinding()]
    param
    (
        [object]$Configuration
    )
    return [DBOpsConfig]::new() | Get-DBOConfig -Configuration $Configuration
}