Skip to content

Commit

Permalink
LyncConnector - minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NileshGhodekar committed Feb 15, 2016
1 parent 9f9faaf commit aadc661
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 56 deletions.
52 changes: 29 additions & 23 deletions src/LyncConnector/Scripts/1. Lync.Common.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ function Enter-Script
Also clear the $Error variable.
#>
[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[string]
$ScriptType
)

Write-Verbose "$Global:ConnectorName - $ScriptType Script: Execution Started..."
$Error.Clear()
process
{
Write-Verbose "$Global:ConnectorName - $ScriptType Script: Execution Started..."
$Error.Clear()
}
}

function Exit-Script
Expand All @@ -54,7 +57,7 @@ function Exit-Script
Throws an exception if $Error is present
#>
[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[string]
$ScriptType,
Expand All @@ -66,19 +69,22 @@ function Exit-Script
$ExceptionRaisedOnErrorCheck
)

if ($Error.Count -ne 0 -and !$SuppressErrorCheck)
process
{
$errorMessage = [string]$Error[0]

if ($ExceptionRaisedOnErrorCheck -eq $null)
if ($Error.Count -ne 0 -and !$SuppressErrorCheck)
{
$ExceptionRaisedOnErrorCheck = [Microsoft.MetadirectoryServices.ExtensibleExtensionException]
$errorMessage = [string]$Error[0]

if ($ExceptionRaisedOnErrorCheck -eq $null)
{
$ExceptionRaisedOnErrorCheck = [Microsoft.MetadirectoryServices.ExtensibleExtensionException]
}

throw $errorMessage -as $ExceptionRaisedOnErrorCheck
}

throw $errorMessage -as $ExceptionRaisedOnErrorCheck
Write-Verbose "$Global:ConnectorName - $ScriptType Script: Execution Completed."
}

Write-Verbose "$Global:ConnectorName - $ScriptType Script: Execution Completed."
}

function Get-ExtensionsDirectory
Expand All @@ -92,7 +98,7 @@ function Get-ExtensionsDirectory
#>
[CmdletBinding()]
[OutputType([string])]
param (
param(
)

process
Expand Down Expand Up @@ -123,7 +129,7 @@ function New-GenericObject

[CmdletBinding()]
[OutputType([object])]
param (
param(
[parameter(Mandatory = $true)]
[string]
$TypeName,
Expand Down Expand Up @@ -172,7 +178,7 @@ function Test-Variable

[CmdletBinding()]
[OutputType([bool])]
param (
param(
[parameter(Mandatory = $true)]
[string]
$Name,
Expand Down Expand Up @@ -209,7 +215,7 @@ function ConvertFrom-SchemaXml

[CmdletBinding()]
[OutputType([Microsoft.MetadirectoryServices.Schema])]
param (
param(
[parameter(Mandatory = $true)]
[ValidateScript({ Test-Path $_ -PathType "Leaf" })]
[string]
Expand Down Expand Up @@ -281,7 +287,7 @@ function Get-CSEntryChangeValue

[CmdletBinding()]
[OutputType([object])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange,
Expand Down Expand Up @@ -349,7 +355,7 @@ function Get-CSEntryChangeValueIfChanged

[CmdletBinding()]
[OutputType([object])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange,
Expand Down Expand Up @@ -411,7 +417,7 @@ function Test-CSEntryChangeValueChanged

[CmdletBinding()]
[OutputType([bool])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange,
Expand Down Expand Up @@ -484,7 +490,7 @@ function Test-CSEntryChangeAttributeDeleted

[CmdletBinding()]
[OutputType([bool])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange,
Expand Down Expand Up @@ -524,7 +530,7 @@ function Get-CSEntryChangeDN

[CmdletBinding()]
[OutputType([string])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -553,7 +559,7 @@ function Get-ConfigParameter

[CmdletBinding()]
[OutputType([string])]
param (
param(
[parameter(Mandatory = $true)]
[System.Collections.ObjectModel.KeyedCollection[string,Microsoft.MetadirectoryServices.ConfigParameter]]
$ConfigParameters,
Expand Down Expand Up @@ -959,7 +965,7 @@ function Select-PreferredDomainController

[CmdletBinding()]
[OutputType([string])]
param (
param(
[parameter(Mandatory = $false)]
[string]
$DomainControllerList
Expand Down
20 changes: 10 additions & 10 deletions src/LyncConnector/Scripts/10. ExportScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[System.Collections.ObjectModel.KeyedCollection[string,Microsoft.MetadirectoryServices.ConfigParameter]]
$ConfigParameters,
Expand Down Expand Up @@ -51,7 +51,7 @@ function Export-CSEntries

[CmdletBinding()]
[OutputType([System.Collections.Generic.List[Microsoft.MetadirectoryServices.CSEntryChangeResult]])]
param (
param(
)

$csentryChangeResults = New-GenericObject System.Collections.Generic.List Microsoft.MetadirectoryServices.CSEntryChangeResult
Expand Down Expand Up @@ -127,7 +127,7 @@ function Export-User

[CmdletBinding()]
[OutputType([Hashtable])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -212,7 +212,7 @@ function Export-OrganizationalUnit

[CmdletBinding()]
[OutputType([Hashtable])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -283,7 +283,7 @@ function Invoke-EnableCsUserCommand
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -333,7 +333,7 @@ function Invoke-SetCsUserCommand
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -387,7 +387,7 @@ function Invoke-GrantCsPolicyCommands
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -457,7 +457,7 @@ function Invoke-MoveCsUserCommand
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -493,7 +493,7 @@ function Invoke-DisableCsUserCommand
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down Expand Up @@ -548,7 +548,7 @@ function Get-CsIdentity

[CmdletBinding()]
[OutputType([string])]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.CSEntryChange]
$CSEntryChange
Expand Down
2 changes: 1 addition & 1 deletion src/LyncConnector/Scripts/11. End-ExportScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[System.Collections.ObjectModel.KeyedCollection[string,Microsoft.MetadirectoryServices.ConfigParameter]]
$ConfigParameters,
Expand Down
8 changes: 4 additions & 4 deletions src/LyncConnector/Scripts/2. ValidationScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[System.Collections.ObjectModel.KeyedCollection[string,Microsoft.MetadirectoryServices.ConfigParameter]]
$ConfigParameters,
Expand Down Expand Up @@ -48,7 +48,7 @@ function Test-ConfigParameterPage

[CmdletBinding()]
[OutputType([Microsoft.MetadirectoryServices.ParameterValidationResult])]
param (
param(
)

$validationResult = New-Object -TypeName "Microsoft.MetadirectoryServices.ParameterValidationResult" -ArgumentList "Success", $null, $null
Expand Down Expand Up @@ -95,7 +95,7 @@ function Test-ConnectivityConfigParameterPage

[CmdletBinding()]
[OutputType([Microsoft.MetadirectoryServices.ParameterValidationResult])]
param (
param(
[parameter(Mandatory = $false)]
[ValidateSet("Partition", "Connectivity", "")]
[string]
Expand Down Expand Up @@ -199,7 +199,7 @@ function Test-GlobalConfigParameterPage

[CmdletBinding()]
[OutputType([Microsoft.MetadirectoryServices.ParameterValidationResult])]
param (
param(
)

$validationResult = New-Object -TypeName "Microsoft.MetadirectoryServices.ParameterValidationResult" -ArgumentList "Success", $null, $null
Expand Down
2 changes: 1 addition & 1 deletion src/LyncConnector/Scripts/3. SchemaScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Get-ConnectorSchema

[CmdletBinding()]
[OutputType([Microsoft.MetadirectoryServices.Schema])]
param (
param(
)

$extensionsDir = Get-ExtensionsDirectory
Expand Down
4 changes: 2 additions & 2 deletions src/LyncConnector/Scripts/4. PartitionScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[System.Collections.ObjectModel.KeyedCollection[string,Microsoft.MetadirectoryServices.ConfigParameter]]
$ConfigParameters,
Expand Down Expand Up @@ -45,7 +45,7 @@ function Get-Partitions

[CmdletBinding()]
[OutputType([System.Collections.Generic.List[Microsoft.MetadirectoryServices.Partition]])]
param (
param(
)

$partitions = New-GenericObject System.Collections.Generic.List Microsoft.MetadirectoryServices.Partition
Expand Down
4 changes: 2 additions & 2 deletions src/LyncConnector/Scripts/5. HierarchyScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[Microsoft.MetadirectoryServices.HierarchyNode]
$HierarchyNode,
Expand Down Expand Up @@ -48,7 +48,7 @@ function Get-Hierarchy

[CmdletBinding()]
[OutputType([System.Collections.Generic.List[Microsoft.MetadirectoryServices.HierarchyNode]])]
param (
param(
)

$children = New-GenericObject System.Collections.Generic.List Microsoft.MetadirectoryServices.HierarchyNode
Expand Down
6 changes: 3 additions & 3 deletions src/LyncConnector/Scripts/6. Begin-ImportScript-Lync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#>

[CmdletBinding()]
param (
param(
[parameter(Mandatory = $true)]
[System.Collections.ObjectModel.KeyedCollection[string,Microsoft.MetadirectoryServices.ConfigParameter]]
$ConfigParameters,
Expand Down Expand Up @@ -50,7 +50,7 @@ function Get-OpenImportConnectionResults

[CmdletBinding()]
[OutputType([System.Collections.Generic.List[Microsoft.MetadirectoryServices.OpenImportConnectionResults]])]
param (
param(
)

$watermark = Get-WaterMark
Expand All @@ -71,7 +71,7 @@ function Get-WaterMark

[CmdletBinding()]
[OutputType([xml])]
param (
param(
)

$waterMarkXml = $null
Expand Down
Loading

0 comments on commit aadc661

Please sign in to comment.