Skip to content

Commit b57382d

Browse files
committed
adjusting parameters to be mandatory
1 parent 9c342dd commit b57382d

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

functions/Set-DBODefaultSetting.ps1

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@ function Set-DBODefaultSetting {
22
<#
33
.SYNOPSIS
44
Sets configuration entries.
5-
5+
66
.DESCRIPTION
77
This function creates or changes configuration values.
88
These can be used to provide dynamic configuration information outside the PowerShell variable system.
9-
9+
1010
.PARAMETER Name
1111
Name of the configuration entry.
12-
12+
1313
.PARAMETER Value
1414
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+
2016
.PARAMETER Append
2117
Adds the value to the existing configuration instead of overwriting it
22-
18+
2319
.PARAMETER Temporary
2420
The setting is not persisted outside the current session.
2521
By default, settings will be remembered across all powershell sessions.
@@ -39,22 +35,23 @@ function Set-DBODefaultSetting {
3935
4036
.EXAMPLE
4137
Set-DBODefaultSetting -Name ConnectionTimeout -Value 5 -Temporary
42-
38+
4339
Change connection timeout setting for the current Powershell session to 5 seconds.
44-
40+
4541
.EXAMPLE
4642
Set-DBODefaultSetting -Name SchemaVersionTable -Value $null
47-
43+
4844
Change the default SchemaVersionTable setting to null, disabling the deployment logging by default
4945
#>
5046
[CmdletBinding(DefaultParameterSetName = "FullName", SupportsShouldProcess)]
5147
param (
48+
[parameter(Mandatory)]
5249
[string]$Name,
50+
[parameter(Mandatory)]
5351
[AllowNull()]
5452
[AllowEmptyCollection()]
5553
[AllowEmptyString()]
5654
$Value,
57-
[System.Management.Automation.ScriptBlock]$Handler,
5855
[switch]$Append,
5956
[switch]$Temporary,
6057
[ValidateSet('CurrentUser', 'AllUsers')]
@@ -66,7 +63,7 @@ function Set-DBODefaultSetting {
6663
Stop-PSFFunction -Message "Setting named $Name does not exist." -EnableException $true
6764
return
6865
}
69-
66+
7067
$newValue = $Value
7168
if ($append) {
7269
$newValue += (Get-DBODefaultSetting -Name $Name -Value)

0 commit comments

Comments
 (0)