@@ -34,14 +34,17 @@ function Enter-Script
3434 Also clear the $Error variable.
3535 #>
3636 [CmdletBinding ()]
37- param (
37+ param (
3838 [parameter (Mandatory = $true )]
3939 [string ]
4040 $ScriptType
4141 )
4242
43- Write-Verbose " $Global :ConnectorName - $ScriptType Script: Execution Started..."
44- $Error.Clear ()
43+ process
44+ {
45+ Write-Verbose " $Global :ConnectorName - $ScriptType Script: Execution Started..."
46+ $Error.Clear ()
47+ }
4548}
4649
4750function Exit-Script
@@ -54,7 +57,7 @@ function Exit-Script
5457 Throws an exception if $Error is present
5558 #>
5659 [CmdletBinding ()]
57- param (
60+ param (
5861 [parameter (Mandatory = $true )]
5962 [string ]
6063 $ScriptType ,
@@ -66,19 +69,22 @@ function Exit-Script
6669 $ExceptionRaisedOnErrorCheck
6770 )
6871
69- if ( $Error .Count -ne 0 -and ! $SuppressErrorCheck )
72+ process
7073 {
71- $errorMessage = [string ]$Error [0 ]
72-
73- if ($ExceptionRaisedOnErrorCheck -eq $null )
74+ if ($Error.Count -ne 0 -and ! $SuppressErrorCheck )
7475 {
75- $ExceptionRaisedOnErrorCheck = [Microsoft.MetadirectoryServices.ExtensibleExtensionException ]
76+ $errorMessage = [string ]$Error [0 ]
77+
78+ if ($ExceptionRaisedOnErrorCheck -eq $null )
79+ {
80+ $ExceptionRaisedOnErrorCheck = [Microsoft.MetadirectoryServices.ExtensibleExtensionException ]
81+ }
82+
83+ throw $errorMessage -as $ExceptionRaisedOnErrorCheck
7684 }
7785
78- throw $errorMessage -as $ExceptionRaisedOnErrorCheck
86+ Write-Verbose " $ Global :ConnectorName - $ScriptType Script: Execution Completed. "
7987 }
80-
81- Write-Verbose " $Global :ConnectorName - $ScriptType Script: Execution Completed."
8288}
8389
8490function Get-ExtensionsDirectory
@@ -92,7 +98,7 @@ function Get-ExtensionsDirectory
9298 #>
9399 [CmdletBinding ()]
94100 [OutputType ([string ])]
95- param (
101+ param (
96102 )
97103
98104 process
@@ -123,7 +129,7 @@ function New-GenericObject
123129
124130 [CmdletBinding ()]
125131 [OutputType ([object ])]
126- param (
132+ param (
127133 [parameter (Mandatory = $true )]
128134 [string ]
129135 $TypeName ,
@@ -172,7 +178,7 @@ function Test-Variable
172178
173179 [CmdletBinding ()]
174180 [OutputType ([bool ])]
175- param (
181+ param (
176182 [parameter (Mandatory = $true )]
177183 [string ]
178184 $Name ,
@@ -209,7 +215,7 @@ function ConvertFrom-SchemaXml
209215
210216 [CmdletBinding ()]
211217 [OutputType ([Microsoft.MetadirectoryServices.Schema ])]
212- param (
218+ param (
213219 [parameter (Mandatory = $true )]
214220 [ValidateScript ({ Test-Path $_ - PathType " Leaf" })]
215221 [string ]
@@ -281,7 +287,7 @@ function Get-CSEntryChangeValue
281287
282288 [CmdletBinding ()]
283289 [OutputType ([object ])]
284- param (
290+ param (
285291 [parameter (Mandatory = $true )]
286292 [Microsoft.MetadirectoryServices.CSEntryChange ]
287293 $CSEntryChange ,
@@ -349,7 +355,7 @@ function Get-CSEntryChangeValueIfChanged
349355
350356 [CmdletBinding ()]
351357 [OutputType ([object ])]
352- param (
358+ param (
353359 [parameter (Mandatory = $true )]
354360 [Microsoft.MetadirectoryServices.CSEntryChange ]
355361 $CSEntryChange ,
@@ -411,7 +417,7 @@ function Test-CSEntryChangeValueChanged
411417
412418 [CmdletBinding ()]
413419 [OutputType ([bool ])]
414- param (
420+ param (
415421 [parameter (Mandatory = $true )]
416422 [Microsoft.MetadirectoryServices.CSEntryChange ]
417423 $CSEntryChange ,
@@ -484,7 +490,7 @@ function Test-CSEntryChangeAttributeDeleted
484490
485491 [CmdletBinding ()]
486492 [OutputType ([bool ])]
487- param (
493+ param (
488494 [parameter (Mandatory = $true )]
489495 [Microsoft.MetadirectoryServices.CSEntryChange ]
490496 $CSEntryChange ,
@@ -524,7 +530,7 @@ function Get-CSEntryChangeDN
524530
525531 [CmdletBinding ()]
526532 [OutputType ([string ])]
527- param (
533+ param (
528534 [parameter (Mandatory = $true )]
529535 [Microsoft.MetadirectoryServices.CSEntryChange ]
530536 $CSEntryChange
@@ -553,7 +559,7 @@ function Get-ConfigParameter
553559
554560 [CmdletBinding ()]
555561 [OutputType ([string ])]
556- param (
562+ param (
557563 [parameter (Mandatory = $true )]
558564 [System.Collections.ObjectModel.KeyedCollection [string , Microsoft.MetadirectoryServices.ConfigParameter ]]
559565 $ConfigParameters ,
@@ -959,7 +965,7 @@ function Select-PreferredDomainController
959965
960966 [CmdletBinding ()]
961967 [OutputType ([string ])]
962- param (
968+ param (
963969 [parameter (Mandatory = $false )]
964970 [string ]
965971 $DomainControllerList
0 commit comments