@@ -2,24 +2,20 @@ function Set-DBODefaultSetting {
2
2
<#
3
3
. SYNOPSIS
4
4
Sets configuration entries.
5
-
5
+
6
6
. DESCRIPTION
7
7
This function creates or changes configuration values.
8
8
These can be used to provide dynamic configuration information outside the PowerShell variable system.
9
-
9
+
10
10
. PARAMETER Name
11
11
Name of the configuration entry.
12
-
12
+
13
13
. PARAMETER Value
14
14
The value to assign to the named configuration element.
15
-
16
- . PARAMETER Handler
17
- A scriptblock that is executed when a value is being set.
18
- Is only executed if the validation was successful (assuming there was a validation, of course)
19
-
15
+
20
16
. PARAMETER Append
21
17
Adds the value to the existing configuration instead of overwriting it
22
-
18
+
23
19
. PARAMETER Temporary
24
20
The setting is not persisted outside the current session.
25
21
By default, settings will be remembered across all powershell sessions.
@@ -39,22 +35,23 @@ function Set-DBODefaultSetting {
39
35
40
36
. EXAMPLE
41
37
Set-DBODefaultSetting -Name ConnectionTimeout -Value 5 -Temporary
42
-
38
+
43
39
Change connection timeout setting for the current Powershell session to 5 seconds.
44
-
40
+
45
41
. EXAMPLE
46
42
Set-DBODefaultSetting -Name SchemaVersionTable -Value $null
47
-
43
+
48
44
Change the default SchemaVersionTable setting to null, disabling the deployment logging by default
49
45
#>
50
46
[CmdletBinding (DefaultParameterSetName = " FullName" , SupportsShouldProcess )]
51
47
param (
48
+ [parameter (Mandatory )]
52
49
[string ]$Name ,
50
+ [parameter (Mandatory )]
53
51
[AllowNull ()]
54
52
[AllowEmptyCollection ()]
55
53
[AllowEmptyString ()]
56
54
$Value ,
57
- [System.Management.Automation.ScriptBlock ]$Handler ,
58
55
[switch ]$Append ,
59
56
[switch ]$Temporary ,
60
57
[ValidateSet (' CurrentUser' , ' AllUsers' )]
@@ -66,7 +63,7 @@ function Set-DBODefaultSetting {
66
63
Stop-PSFFunction - Message " Setting named $Name does not exist." - EnableException $true
67
64
return
68
65
}
69
-
66
+
70
67
$newValue = $Value
71
68
if ($append ) {
72
69
$newValue += (Get-DBODefaultSetting - Name $Name - Value)
0 commit comments