From 9a394da566910c2e84578b12109731a04e3dfacf Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 13:59:07 +1000 Subject: [PATCH 01/69] Fixed get method of xSPInstall --- .../MSFT_xSPInstall/MSFT_xSPInstall.psm1 | 21 +++++--- .../MSFT_xSPSite/MSFT_xSPSite.psm1 | 1 - .../xSharePoint.Util/xSharePoint.Util.psm1 | 49 +++++++++++++------ Modules/xSharePoint/xSharePoint.psd1 | 4 +- Tests/Tests.pssproj | 1 + Tests/xSharePoint/xSharePoint.Util.Tests.ps1 | 48 ++++++++++++++++++ .../xSharePoint.xSPInstall.Tests.ps1 | 10 ++-- 7 files changed, 104 insertions(+), 30 deletions(-) create mode 100644 Tests/xSharePoint/xSharePoint.Util.Tests.ps1 diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 index 2aeb45701..3c43b2a99 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 @@ -16,12 +16,17 @@ function Get-TargetResource Write-Verbose -Message "Getting install status of SP binaries" $spInstall = Get-CimInstance -ClassName Win32_Product -Filter "Name like 'Microsoft SharePoint Server%'" - $result = ($null -ne $spInstall) - $returnValue = @{ - SharePointInstalled = $result + if ($spInstall) { + return @{ + BinaryDir = $BinaryDir + ProductKey = $ProductKey + } + } else { + return @{ + BinaryDir = $null + ProductKey = $ProductKey + } } - - return $returnValue } @@ -94,9 +99,11 @@ function Test-TargetResource $ProductKey ) - $result = Get-TargetResource -BinaryDir $BinaryDir -ProductKey $ProductKey + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing for installation of SharePoint" - $result.SharePointInstalled + + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 index aa6b8d1d4..ca07f0035 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 @@ -145,7 +145,6 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $params = Remove-xSharePointNullParamValues -Params $params $params.Remove("InstallAccount") | Out-Null $site = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPSite" -Arguments @{ Identity = $params.Url } -ErrorAction SilentlyContinue diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 725b5a4b0..b721234eb 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -118,22 +118,6 @@ function Rename-xSharePointParamValue() { return $params } -function Remove-xSharePointNullParamValues() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - $Params - ) - $keys = $Params.Keys - ForEach ($key in $keys) { - if ($null -eq $Params.$key) { - $Params.Remove($key) | Out-Null - } - } - return $Params -} - function Get-xSharePointInstalledProductVersion() { $pathToSearch = "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\*\ISAPI\Microsoft.SharePoint.dll" $fullPath = Get-Item $pathToSearch | Sort-Object { $_.Directory } -Descending | Select-Object -First 1 @@ -162,4 +146,37 @@ function Update-xSharePointObject() { $InputObject.Update() } +function Test-xSharePointSpecificParameters() { + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true,Position=1)] + [HashTable] + $CurrentValues, + + [parameter(Mandatory = $true,Position=2)] + [HashTable] + $DesiredValues, + + [parameter(Mandatory = $false,Position=3)] + [Array] + $ValuesToCheck + ) + + $returnValue = $true + + if (($ValuesToCheck -eq $null) -or ($ValuesToCheck.Count -lt 1)) { + $KeyList = $DesiredValues.Keys + } else { + $KeyList = $ValuesToCheck + } + + $KeyList | ForEach-Object { + if ((-not $CurrentValues.ContainsKey($_)) -or ($CurrentValues.$_ -ne $DesiredValues.$_)) { + $returnValue = $false + } + } + return $returnValue +} + Export-ModuleMember -Function * diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index dd8446f3c..2f600eaad 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -81,7 +81,6 @@ CmdletsToExport = @("Add-xSharePointDistributedCacheServer", "Invoke-xSharePointSPCmdlet", "Invoke-xSharePointDCCmdlet", "Rename-xSharePointParamValue", - "Remove-xSharePointNullParamValues", "Update-xSharePointObject", "Get-xSharePointServiceApplication", "Set-xSharePointCacheReaderPolicy", @@ -92,7 +91,8 @@ CmdletsToExport = @("Add-xSharePointDistributedCacheServer", "Add-xSharePointUserToLocalAdmin", "Remove-xSharePointUserToLocalAdmin", "Test-xSharePointUserIsLocalAdmin", - "Set-xSharePointUserProfileSyncMachine") + "Set-xSharePointUserProfileSyncMachine", + "Test-xSharePointSpecificParameters") # Variables to export from this module VariablesToExport = '*' diff --git a/Tests/Tests.pssproj b/Tests/Tests.pssproj index cd3f7e6aa..b21b06b52 100644 --- a/Tests/Tests.pssproj +++ b/Tests/Tests.pssproj @@ -54,6 +54,7 @@ + diff --git a/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 b/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 new file mode 100644 index 000000000..4d117ae6f --- /dev/null +++ b/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 @@ -0,0 +1,48 @@ +[CmdletBinding()] +param() + +if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 +{ + $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) +} + +$ErrorActionPreference = 'stop' +Set-StrictMode -Version latest + +$RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path + +$ModuleName = "xSharePoint.Util" +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") + +Describe "xSharePoint.Util" { + Context "Validate Test-xSharePointSpecificParameters" { + It "Returns true for two identical tables" { + $desired = @{ Example = "test" } + Test-xSharePointSpecificParameters -CurrentValues $desired -DesiredValues $desired | Should Be $true + } + + It "Returns false when a value is different" { + $current = @{ Example = "something" } + $desired = @{ Example = "test" } + Test-xSharePointSpecificParameters -CurrentValues $current -DesiredValues $desired | Should Be $false + } + + It "Returns false when a value is missing" { + $current = @{ } + $desired = @{ Example = "test" } + Test-xSharePointSpecificParameters -CurrentValues $current -DesiredValues $desired | Should Be $false + } + + It "Returns true when only a specified value matches, but other non-listed values do not" { + $current = @{ Example = "test"; SecondExample = "true" } + $desired = @{ Example = "test"; SecondExample = "false" } + Test-xSharePointSpecificParameters -CurrentValues $current -DesiredValues $desired -ValuesToCheck @("Example") | Should Be $true + } + + It "Returns false when only specified values do not match, but other non-listed values do " { + $current = @{ Example = "test"; SecondExample = "true" } + $desired = @{ Example = "test"; SecondExample = "false" } + Test-xSharePointSpecificParameters -CurrentValues $current -DesiredValues $desired -ValuesToCheck @("SecondExample") | Should Be $false + } + } +} \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index 487244dea..6e18c555c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -26,14 +26,14 @@ Describe "xSPInstall" { It "Returns false when SharePoint is not detected" { Mock Get-CimInstance { return $null } -Verifiable $result = Get-TargetResource @testParams - $result.SharePointInstalled | Should Be $false + $result.BinaryDir | Should BeNullOrEmpty Assert-VerifiableMocks } It "Returns true when SharePoint is detected" { Mock Get-CimInstance { return @{} } -Verifiable $result = Get-TargetResource @testParams - $result.SharePointInstalled | Should Be $true + $result.BinaryDir | Should Not BeNullOrEmpty Assert-VerifiableMocks } } @@ -42,7 +42,8 @@ Describe "xSPInstall" { It "Passes when SharePoint is installed" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - SharePointInstalled = $true + BinaryDir = $testParams.BinaryDir + ProductKey = $testParams.ProductKey } } Test-TargetResource @testParams | Should Be $true @@ -50,7 +51,8 @@ Describe "xSPInstall" { It "Fails when SharePoint is not installed" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - SharePointInstalled = $false + BinaryDir = $null + ProductKey = $testParams.ProductKey } } Test-TargetResource @testParams | Should Be $false From 90e051647cd1af04accfa55b7bc5aa7efd09b437 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 14:21:51 +1000 Subject: [PATCH 02/69] Added Ensure parameter to xSPInstall --- .../MSFT_xSPInstall/MSFT_xSPInstall.psm1 | 44 +++++++++---------- .../MSFT_xSPInstall.schema.mof | 1 + .../Examples/Single Server/SharePoint.ps1 | 1 + .../Examples/Small Farm/AppServer.ps1 | 1 + .../Examples/Small Farm/FirstServer.ps1 | 1 + .../Examples/Small Farm/WFEServer.ps1 | 1 + .../xSharePoint.xSPInstall.Tests.ps1 | 23 +++++++++- 7 files changed, 48 insertions(+), 24 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 index 3c43b2a99..c3f503845 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 @@ -4,13 +4,9 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $BinaryDir, - - [parameter(Mandatory = $true)] - [System.String] - $ProductKey + [parameter(Mandatory = $true)] [System.String] $BinaryDir, + [parameter(Mandatory = $true)] [System.String] $ProductKey, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) Write-Verbose -Message "Getting install status of SP binaries" @@ -20,11 +16,13 @@ function Get-TargetResource return @{ BinaryDir = $BinaryDir ProductKey = $ProductKey + Ensure = "Present" } } else { return @{ - BinaryDir = $null + BinaryDir = $BinaryDir ProductKey = $ProductKey + Ensure = "Absent" } } } @@ -35,15 +33,16 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $BinaryDir, - - [parameter(Mandatory = $true)] - [System.String] - $ProductKey + [parameter(Mandatory = $true)] [System.String] $BinaryDir, + [parameter(Mandatory = $true)] [System.String] $ProductKey, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) + if ($Ensure -eq "Absent") { + throw [Exception] "xSharePoint does not support uninstalling SharePoint. Please remove this manually." + return + } + Write-Verbose -Message "Writing install config file" $configPath = "$env:temp\SPInstallConfig.xml" @@ -90,15 +89,16 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $BinaryDir, - - [parameter(Mandatory = $true)] - [System.String] - $ProductKey + [parameter(Mandatory = $true)] [System.String] $BinaryDir, + [parameter(Mandatory = $true)] [System.String] $ProductKey, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) + if ($Ensure -eq "Absent") { + throw [Exception] "xSharePoint does not support uninstalling SharePoint. Please remove this manually." + return + } + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for installation of SharePoint" diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof index eb1894f59..fea52d9f5 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.schema.mof @@ -3,5 +3,6 @@ class MSFT_xSPInstall : OMI_BaseResource { [Key] String BinaryDir; [Required] String ProductKey; + [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; }; diff --git a/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 b/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 index 538871a57..bdd56999e 100644 --- a/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 +++ b/Modules/xSharePoint/Examples/Single Server/SharePoint.ps1 @@ -92,6 +92,7 @@ Configuration SharePointServer { BinaryDir = "C:\SPInstall" ProductKey = $ProductKey + Ensure = "Present" DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" } diff --git a/Modules/xSharePoint/Examples/Small Farm/AppServer.ps1 b/Modules/xSharePoint/Examples/Small Farm/AppServer.ps1 index cee01c84a..0578e3cb5 100644 --- a/Modules/xSharePoint/Examples/Small Farm/AppServer.ps1 +++ b/Modules/xSharePoint/Examples/Small Farm/AppServer.ps1 @@ -92,6 +92,7 @@ Configuration SharePointAppServer { BinaryDir = "C:\SPInstall" ProductKey = $ProductKey + Ensure = "Present" DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" } diff --git a/Modules/xSharePoint/Examples/Small Farm/FirstServer.ps1 b/Modules/xSharePoint/Examples/Small Farm/FirstServer.ps1 index 09b5a231e..776d54b37 100644 --- a/Modules/xSharePoint/Examples/Small Farm/FirstServer.ps1 +++ b/Modules/xSharePoint/Examples/Small Farm/FirstServer.ps1 @@ -92,6 +92,7 @@ Configuration SharePointFarmServer { BinaryDir = "C:\SPInstall" ProductKey = $ProductKey + Ensure = "Present" DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" } diff --git a/Modules/xSharePoint/Examples/Small Farm/WFEServer.ps1 b/Modules/xSharePoint/Examples/Small Farm/WFEServer.ps1 index cfd7b4350..7461de9ea 100644 --- a/Modules/xSharePoint/Examples/Small Farm/WFEServer.ps1 +++ b/Modules/xSharePoint/Examples/Small Farm/WFEServer.ps1 @@ -92,6 +92,7 @@ Configuration SharePointWFEServer { BinaryDir = "C:\SPInstall" ProductKey = $ProductKey + Ensure = "Present" DependsOn = "[xSPInstallPrereqs]InstallPrerequisites" } diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index 6e18c555c..ce92b8fbf 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -19,6 +19,7 @@ Describe "xSPInstall" { $testParams = @{ BinaryDir = "C:\SPInstall" ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" + Ensure = "Present" } Context "Validate get method" { @@ -26,14 +27,12 @@ Describe "xSPInstall" { It "Returns false when SharePoint is not detected" { Mock Get-CimInstance { return $null } -Verifiable $result = Get-TargetResource @testParams - $result.BinaryDir | Should BeNullOrEmpty Assert-VerifiableMocks } It "Returns true when SharePoint is detected" { Mock Get-CimInstance { return @{} } -Verifiable $result = Get-TargetResource @testParams - $result.BinaryDir | Should Not BeNullOrEmpty Assert-VerifiableMocks } } @@ -44,6 +43,7 @@ Describe "xSPInstall" { return @{ BinaryDir = $testParams.BinaryDir ProductKey = $testParams.ProductKey + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $true @@ -53,10 +53,24 @@ Describe "xSPInstall" { return @{ BinaryDir = $null ProductKey = $testParams.ProductKey + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $false } + + $testParams.Ensure = "Absent" + It "Throws an error if SharePoint should be absent" { + Mock -ModuleName $ModuleName Get-TargetResource { + return @{ + BinaryDir = $null + ProductKey = $testParams.ProductKey + Ensure = "Absent" + } + } + { Test-TargetResource @testParams } | Should Throw + } + $testParams.Ensure = "Present" } Context "Validate set method" { @@ -76,6 +90,11 @@ Describe "xSPInstall" { Assert-VerifiableMocks } + $testParams.Ensure = "Absent" + It "Throws an error when SharePoint should be absent" { + { Set-TargetResource @testParams } | Should Throw + } + $testParams.Ensure = "Present" } } } \ No newline at end of file From 7da3a7ca1a37e9812324ff521a5cb74ee5ae3c7c Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 14:39:10 +1000 Subject: [PATCH 03/69] Updated get method of xSPInstallPrereqs --- .../MSFT_xSPInstall/MSFT_xSPInstall.psm1 | 6 +- .../MSFT_xSPInstallPrereqs.psm1 | 253 +++++------------- .../MSFT_xSPInstallPrereqs.schema.mof | 3 +- .../xSharePoint.xSPInstall.Tests.ps1 | 14 +- .../xSharePoint.xSPInstallPrereqs.Tests.ps1 | 62 ++--- 5 files changed, 101 insertions(+), 237 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 index c3f503845..5ec9e13ed 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstall/MSFT_xSPInstall.psm1 @@ -39,7 +39,7 @@ function Set-TargetResource ) if ($Ensure -eq "Absent") { - throw [Exception] "xSharePoint does not support uninstalling SharePoint. Please remove this manually." + throw [Exception] "xSharePoint does not support uninstalling SharePoint or its prerequisites. Please remove this manually." return } @@ -95,7 +95,7 @@ function Test-TargetResource ) if ($Ensure -eq "Absent") { - throw [Exception] "xSharePoint does not support uninstalling SharePoint. Please remove this manually." + throw [Exception] "xSharePoint does not support uninstalling SharePoint or its prerequisites. Please remove this manually." return } @@ -103,7 +103,7 @@ function Test-TargetResource Write-Verbose -Message "Testing for installation of SharePoint" - return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure") } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 index 83c5b109e..67eea7012 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 @@ -4,65 +4,22 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $InstallerPath, - - [parameter(Mandatory = $false)] - [System.Boolean] - $OnlineMode = $true, - - [parameter(Mandatory = $false)] - [System.String] - $SQLNCli, - - [parameter(Mandatory = $false)] - [System.String] - $PowerShell, - - [parameter(Mandatory = $false)] - [System.String] - $NETFX, - - [parameter(Mandatory = $false)] - [System.String] - $IDFX, - - [parameter(Mandatory = $false)] - [System.String] - $Sync, - - [parameter(Mandatory = $false)] - [System.String] - $AppFabric, - - [parameter(Mandatory = $false)] - [System.String] - $IDFX11, - - [parameter(Mandatory = $false)] - [System.String] - $MSIPCClient, - - [parameter(Mandatory = $false)] - [System.String] - $WCFDataServices, - - [parameter(Mandatory = $false)] - [System.String] - $KB2671763, - - [parameter(Mandatory = $false)] - [System.String] - $WCFDataServices56, - - [parameter(Mandatory = $false)] - [System.String] - $KB2898850, - - [parameter(Mandatory = $false)] - [System.String] - $MSVCRT12 + [parameter(Mandatory = $true)] [System.String] $InstallerPath, + [parameter(Mandatory = $true)] [System.Boolean] $OnlineMode, + [parameter(Mandatory = $false)] [System.String] $SQLNCli, + [parameter(Mandatory = $false)] [System.String] $PowerShell, + [parameter(Mandatory = $false)] [System.String] $NETFX, + [parameter(Mandatory = $false)] [System.String] $IDFX, + [parameter(Mandatory = $false)] [System.String] $Sync, + [parameter(Mandatory = $false)] [System.String] $AppFabric, + [parameter(Mandatory = $false)] [System.String] $IDFX11, + [parameter(Mandatory = $false)] [System.String] $MSIPCClient, + [parameter(Mandatory = $false)] [System.String] $WCFDataServices, + [parameter(Mandatory = $false)] [System.String] $KB2671763, + [parameter(Mandatory = $false)] [System.String] $WCFDataServices56, + [parameter(Mandatory = $false)] [System.String] $KB2898850, + [parameter(Mandatory = $false)] [System.String] $MSVCRT12, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) $returnValue = @{} @@ -113,7 +70,15 @@ function Get-TargetResource $returnValue.Add("Microsoft SQL Server 2012 Native Client", (($installedItems | ? {$_.Name -ne $null -and $_.Name.Trim() -eq "Microsoft SQL Server 2012 Native Client"}) -ne $null)) $returnValue.Add("Active Directory Rights Management Services Client 2.1", (($installedItems | ? {$_.Name -eq "Active Directory Rights Management Services Client 2.1"}) -ne $null)) } - $returnValue + + $results = $PSBoundParameters + if (($returnValue.Values | Where-Object { $_ -eq $false }).Count -gt 0) { + $results.Ensure = "Absent" + } else { + $results.Ensure = "Present" + } + + return $results } @@ -122,67 +87,29 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $InstallerPath, - - [parameter(Mandatory = $false)] - [System.Boolean] - $OnlineMode = $true, - - [parameter(Mandatory = $false)] - [System.String] - $SQLNCli, - - [parameter(Mandatory = $false)] - [System.String] - $PowerShell, - - [parameter(Mandatory = $false)] - [System.String] - $NETFX, - - [parameter(Mandatory = $false)] - [System.String] - $IDFX, - - [parameter(Mandatory = $false)] - [System.String] - $Sync, - - [parameter(Mandatory = $false)] - [System.String] - $AppFabric, - - [parameter(Mandatory = $false)] - [System.String] - $IDFX11, - - [parameter(Mandatory = $false)] - [System.String] - $MSIPCClient, - - [parameter(Mandatory = $false)] - [System.String] - $WCFDataServices, - - [parameter(Mandatory = $false)] - [System.String] - $KB2671763, - - [parameter(Mandatory = $false)] - [System.String] - $WCFDataServices56, - - [parameter(Mandatory = $false)] - [System.String] - $KB2898850, - - [parameter(Mandatory = $false)] - [System.String] - $MSVCRT12 + [parameter(Mandatory = $true)] [System.String] $InstallerPath, + [parameter(Mandatory = $true)] [System.Boolean] $OnlineMode, + [parameter(Mandatory = $false)] [System.String] $SQLNCli, + [parameter(Mandatory = $false)] [System.String] $PowerShell, + [parameter(Mandatory = $false)] [System.String] $NETFX, + [parameter(Mandatory = $false)] [System.String] $IDFX, + [parameter(Mandatory = $false)] [System.String] $Sync, + [parameter(Mandatory = $false)] [System.String] $AppFabric, + [parameter(Mandatory = $false)] [System.String] $IDFX11, + [parameter(Mandatory = $false)] [System.String] $MSIPCClient, + [parameter(Mandatory = $false)] [System.String] $WCFDataServices, + [parameter(Mandatory = $false)] [System.String] $KB2671763, + [parameter(Mandatory = $false)] [System.String] $WCFDataServices56, + [parameter(Mandatory = $false)] [System.String] $KB2898850, + [parameter(Mandatory = $false)] [System.String] $MSVCRT12, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) + if ($Ensure -eq "Absent") { + throw [Exception] "xSharePoint does not support uninstalling SharePoint or its prerequisites. Please remove this manually." + return + } + Write-Verbose -Message "Detecting SharePoint version from binaries" $majorVersion = (Get-xSharePointAssemblyVersion -PathToAssembly $InstallerPath) if ($majorVersion -eq 15) { @@ -242,76 +169,34 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $InstallerPath, - - [parameter(Mandatory = $false)] - [System.Boolean] - $OnlineMode = $true, - - [parameter(Mandatory = $false)] - [System.String] - $SQLNCli, - - [parameter(Mandatory = $false)] - [System.String] - $PowerShell, - - [parameter(Mandatory = $false)] - [System.String] - $NETFX, - - [parameter(Mandatory = $false)] - [System.String] - $IDFX, - - [parameter(Mandatory = $false)] - [System.String] - $Sync, - - [parameter(Mandatory = $false)] - [System.String] - $AppFabric, - - [parameter(Mandatory = $false)] - [System.String] - $IDFX11, - - [parameter(Mandatory = $false)] - [System.String] - $MSIPCClient, - - [parameter(Mandatory = $false)] - [System.String] - $WCFDataServices, - - [parameter(Mandatory = $false)] - [System.String] - $KB2671763, - - [parameter(Mandatory = $false)] - [System.String] - $WCFDataServices56, - - [parameter(Mandatory = $false)] - [System.String] - $KB2898850, - - [parameter(Mandatory = $false)] - [System.String] - $MSVCRT12 + [parameter(Mandatory = $true)] [System.String] $InstallerPath, + [parameter(Mandatory = $true)] [System.Boolean] $OnlineMode, + [parameter(Mandatory = $false)] [System.String] $SQLNCli, + [parameter(Mandatory = $false)] [System.String] $PowerShell, + [parameter(Mandatory = $false)] [System.String] $NETFX, + [parameter(Mandatory = $false)] [System.String] $IDFX, + [parameter(Mandatory = $false)] [System.String] $Sync, + [parameter(Mandatory = $false)] [System.String] $AppFabric, + [parameter(Mandatory = $false)] [System.String] $IDFX11, + [parameter(Mandatory = $false)] [System.String] $MSIPCClient, + [parameter(Mandatory = $false)] [System.String] $WCFDataServices, + [parameter(Mandatory = $false)] [System.String] $KB2671763, + [parameter(Mandatory = $false)] [System.String] $WCFDataServices56, + [parameter(Mandatory = $false)] [System.String] $KB2898850, + [parameter(Mandatory = $false)] [System.String] $MSVCRT12, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) + if ($Ensure -eq "Absent") { + throw [Exception] "xSharePoint does not support uninstalling SharePoint or its prerequisites. Please remove this manually." + return + } + + $CurrentValues = Get-TargetResource @PSBoundParameters - $result = Get-TargetResource -InstallerPath $InstallerPath Write-Verbose -Message "Checking installation of SharePoint prerequisites" - if (($result.Values | Where-Object { $_ -eq $false }).Count -gt 0) { - Write-Verbose -Message "Prerequisites were detected as missing." - return $false - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure") } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof index 3a446088b..94c9b902c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.schema.mof @@ -2,7 +2,7 @@ class MSFT_xSPInstallPrereqs : OMI_BaseResource { [Key] String InstallerPath; - [Write] Boolean OnlineMode; + [Required] Boolean OnlineMode; [Write] String SQLNCli; [Write] String PowerShell; [Write] String NETFX; @@ -16,5 +16,6 @@ class MSFT_xSPInstallPrereqs : OMI_BaseResource [Write] String WCFDataServices56; [Write] String KB2898850; [Write] String MSVCRT12; + [Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; }; diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index ce92b8fbf..dff6e1289 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -59,8 +59,8 @@ Describe "xSPInstall" { Test-TargetResource @testParams | Should Be $false } - $testParams.Ensure = "Absent" - It "Throws an error if SharePoint should be absent" { + $testParams.Ensure = "Absent" + It "Throws an error if SharePoint should be absent" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ BinaryDir = $null @@ -70,7 +70,7 @@ Describe "xSPInstall" { } { Test-TargetResource @testParams } | Should Throw } - $testParams.Ensure = "Present" + $testParams.Ensure = "Present" } Context "Validate set method" { @@ -90,11 +90,11 @@ Describe "xSPInstall" { Assert-VerifiableMocks } - $testParams.Ensure = "Absent" - It "Throws an error when SharePoint should be absent" { + $testParams.Ensure = "Absent" + It "Throws an error when SharePoint should be absent" { { Set-TargetResource @testParams } | Should Throw - } - $testParams.Ensure = "Present" + } + $testParams.Ensure = "Present" } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index 6548a240e..ca9511ac6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -19,6 +19,7 @@ Describe "xSPInstallPrereqs" { $testParams = @{ InstallerPath = "C:\SPInstall" OnlineMode = $true + Ensure = "Present" } Context "Validate get method" { @@ -36,58 +37,29 @@ Describe "xSPInstallPrereqs" { Context "Validate test method" { It "Passes when all Prereqs are installed" { Mock -ModuleName $ModuleName Get-TargetResource { - $returnValue = @{} - foreach($feature in "Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer".Split(",")) { - $returnValue.Add($feature, $true) + return @{ + InstallerPath = "C:\SPInstall" + OnlineMode = $true + Ensure = "Present" } - $returnValue.Add("Microsoft SQL Server 2008 R2 Native Client", $true) - $returnValue.Add("Microsoft Sync Framework Runtime v1.0 SP1 (x64)", $true) - $returnValue.Add("AppFabric 1.1 for Windows Server", $true) - $returnValue.Add("Microsoft Identity Extensions", $true) - $returnValue.Add("Active Directory Rights Management Services Client 2.0", $true) - $returnValue.Add("WCF Data Services 5.0 (for OData v3) Primary Components", $true) - $returnValue.Add("WCF Data Services 5.6.0 Runtime", $true) - $returnValue.Add("Microsoft CCR and DSS Runtime 2008 R3", $true) - return $returnValue } Test-TargetResource @testParams | Should Be $true } - It "Fails when there are Windows Features missing" { + It "Fails when there are Prereqs missing" { Mock -ModuleName $ModuleName Get-TargetResource { - $returnValue = @{} - foreach($feature in "Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer".Split(",")) { - $returnValue.Add($feature, $false) + return @{ + InstallerPath = "C:\SPInstall" + OnlineMode = $true + Ensure = "Absent" } - $returnValue.Add("Microsoft SQL Server 2008 R2 Native Client", $true) - $returnValue.Add("Microsoft Sync Framework Runtime v1.0 SP1 (x64)", $true) - $returnValue.Add("AppFabric 1.1 for Windows Server", $true) - $returnValue.Add("Microsoft Identity Extensions", $true) - $returnValue.Add("Active Directory Rights Management Services Client 2.0", $true) - $returnValue.Add("WCF Data Services 5.0 (for OData v3) Primary Components", $true) - $returnValue.Add("WCF Data Services 5.6.0 Runtime", $true) - $returnValue.Add("Microsoft CCR and DSS Runtime 2008 R3", $true) - return $returnValue } Test-TargetResource @testParams | Should Be $false } - It "Fails when there are software prereqs missing" { - Mock -ModuleName $ModuleName Get-TargetResource { - $returnValue = @{} - foreach($feature in "Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer".Split(",")) { - $returnValue.Add($feature, $false) - } - $returnValue.Add("Microsoft SQL Server 2008 R2 Native Client", $false) - $returnValue.Add("Microsoft Sync Framework Runtime v1.0 SP1 (x64)", $false) - $returnValue.Add("AppFabric 1.1 for Windows Server", $false) - $returnValue.Add("Microsoft Identity Extensions", $false) - $returnValue.Add("Active Directory Rights Management Services Client 2.0", $false) - $returnValue.Add("WCF Data Services 5.0 (for OData v3) Primary Components", $false) - $returnValue.Add("WCF Data Services 5.6.0 Runtime", $false) - $returnValue.Add("Microsoft CCR and DSS Runtime 2008 R3", $false) - return $returnValue - } - Test-TargetResource @testParams | Should Be $false + $testParams.Ensure = "Absent" + It "Throws an error if SharePoint prereqs should be absent" { + { Test-TargetResource @testParams } | Should Throw } + $testParams.Ensure = "Present" } Context "Validate set method" { @@ -130,6 +102,12 @@ Describe "xSPInstallPrereqs" { { Set-TargetResource @testParams } | Should throw "offline mode" } + + $testParams.Ensure = "Absent" + It "Throws an error if SharePoint prereqs should be absent" { + { Set-TargetResource @testParams } | Should Throw + } + $testParams.Ensure = "Present" } } } \ No newline at end of file From 1fb54073fd16a3551352b0f8221ce215abe39be7 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 14:58:26 +1000 Subject: [PATCH 04/69] Updated get for xSPBCSServiceApp --- .../MSFT_xSPBCSServiceApp.psm1 | 84 +++++-------------- Tests/xSharePoint/xSharePoint.Util.Tests.ps1 | 6 ++ .../xSharePoint.xSPBCSServiceApp.Tests.ps1 | 3 +- 3 files changed, 28 insertions(+), 65 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 index 7070c92d8..35d627fd8 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 @@ -4,25 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting BCS service app '$Name'" @@ -42,6 +28,9 @@ function Get-TargetResource return @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name + DatabaseName = $serviceApp.Database.Name + DatabaseServer = $serviceApp.Database.Server.Name + InstallAccount = $params.InstallAccount } } } @@ -59,25 +48,11 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $result = Get-TargetResource @PSBoundParameters @@ -118,34 +93,17 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for BCS Service Application '$Name'" - if ($result.Count -eq 0) { return $false } - else { - if ($ApplicationPool -ne $result.ApplicationPool) { return $false } - } - return $true + + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } Export-ModuleMember -Function *-TargetResource diff --git a/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 b/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 index 4d117ae6f..9176d93fe 100644 --- a/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 @@ -44,5 +44,11 @@ Describe "xSharePoint.Util" { $desired = @{ Example = "test"; SecondExample = "false" } Test-xSharePointSpecificParameters -CurrentValues $current -DesiredValues $desired -ValuesToCheck @("SecondExample") | Should Be $false } + + It "Returns false when an empty array is used in the current values " { + $current = @{ } + $desired = @{ Example = "test"; SecondExample = "false" } + Test-xSharePointSpecificParameters -CurrentValues $current -DesiredValues $desired | Should Be $false + } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 29c46995f..37697f927 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -12,7 +12,6 @@ Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $ModuleName = "MSFT_xSPBCSServiceApp" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPBCSServiceApp" { @@ -32,7 +31,7 @@ Describe "xSPBCSServiceApp" { } } -Verifiable -ParameterFilter {$Name -eq $testParams.Name -and $TypeName -eq "BCS"} $results = Get-TargetResource @testParams - $results.Count | Should Be 2 + $results | Should Not BeNullOrEmpty Assert-VerifiableMocks } From c84765a2f404a6b3db3b13bf2c29794279b0f10b Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 15:11:41 +1000 Subject: [PATCH 05/69] Updated get method of xSPCacheAccounts --- .../MSFT_xSPCacheAccounts.psm1 | 20 ++++++----------- .../xSharePoint.xSPCacheAccounts.Tests.ps1 | 22 +++++++++---------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 index aa898a748..e7b4ccd22 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 @@ -32,16 +32,16 @@ function Get-TargetResource $returnVal = @{} $returnVal.Add("WebAppUrl", $params.WebAppUrl) if ($wa.Properties.ContainsKey("portalsuperuseraccount")) { - $returnVal.Add("portalsuperuseraccount", $wa.Properties["portalsuperuseraccount"]) + $returnVal.Add("SuperUserAlias", $wa.Properties["portalsuperuseraccount"]) } else { - $returnVal.Add("portalsuperuseraccount", "") + $returnVal.Add("SuperUserAlias", "") } if ($wa.Properties.ContainsKey("portalsuperreaderaccount")) { - $returnVal.Add("portalsuperreaderaccount", $wa.Properties["portalsuperreaderaccount"]) + $returnVal.Add("SuperReaderAlias", $wa.Properties["portalsuperreaderaccount"]) } else { - $returnVal.Add("portalsuperreaderaccount", "") + $returnVal.Add("SuperReaderAlias", "") } - + $returnVal.Add("InstallAccount", $params.InstallAccount) return $returnVal } return $result @@ -119,15 +119,9 @@ function Test-TargetResource $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing cache accounts for $WebAppUrl" - - if ($result.Count -eq 0) { return $false } - else { - if ($SuperUserAlias -ne $result.portalsuperuseraccount) { return $false } - if ($SuperReaderAlias -ne $result.portalsuperreaderaccount) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("SuperUserAlias", "SuperReaderAlias") } Export-ModuleMember -Function *-TargetResource diff --git a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 index ceea381d7..b90843f9e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 @@ -28,13 +28,13 @@ Describe "xSPCacheAccounts" { It "Calls the service application picker with the appropriate type name" { Mock Invoke-xSharePointSPCmdlet { return @{ Properties = @{ - portalsuperuseraccount = $testParams.SuperUserAlias - portalsuperreaderaccount = $testParams.SuperReaderAlias + SuperUserAlias = $testParams.SuperUserAlias + SuperReaderAlias = $testParams.SuperReaderAlias } }} -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } $results = Get-TargetResource @testParams - $results.Count | Should Be 3 + $results.Count | Should Not BeNullOrEmpty Assert-VerifiableMocks } @@ -48,8 +48,8 @@ Describe "xSPCacheAccounts" { It "Passes when the correct accounts are assigned" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - portalsuperuseraccount = $testParams.SuperUserAlias - portalsuperreaderaccount = $testParams.SuperReaderAlias + SuperUserAlias = $testParams.SuperUserAlias + SuperReaderAlias = $testParams.SuperReaderAlias } } Test-TargetResource @testParams | Should Be $true @@ -57,8 +57,8 @@ Describe "xSPCacheAccounts" { It "Fails when the wrong super reader is defined" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - portalsuperuseraccount = $testParams.SuperUserAlias - portalsuperreaderaccount = "DEMO\WrongUser" + SuperUserAlias = $testParams.SuperUserAlias + SuperReaderAlias = "DEMO\WrongUser" } } Test-TargetResource @testParams | Should Be $false @@ -66,8 +66,8 @@ Describe "xSPCacheAccounts" { It "Fails when the wrong super user is defined" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - portalsuperuseraccount = "DEMO\WrongUser" - portalsuperreaderaccount = $testParams.SuperReaderAlias + SuperUserAlias = "DEMO\WrongUser" + SuperReaderAlias = $testParams.SuperReaderAlias } } Test-TargetResource @testParams | Should Be $false @@ -91,8 +91,8 @@ Describe "xSPCacheAccounts" { It "Sets accounts when existing accounts are set" { Mock Invoke-xSharePointSPCmdlet { return @{ Properties = @{ - portalsuperuseraccount = $testParams.SuperUserAlias - portalsuperreaderaccount = $testParams.SuperReaderAlias + SuperUserAlias = $testParams.SuperUserAlias + SuperReaderAlias = $testParams.SuperReaderAlias } } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } Mock Set-xSharePointCacheReaderPolicy { return $null } -Verifiable From 447f4d330848d8efdd2f40ded2433be794bf461d Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 15:37:18 +1000 Subject: [PATCH 06/69] Updated get method for xSPCreateFarm --- .../MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 | 18 +++++++++++++----- .../xSharePoint.xSPCreateFarm.Tests.ps1 | 3 +-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 41ac9c1ea..93cb21078 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -44,8 +44,17 @@ function Get-TargetResource if ($null -eq $spFarm) {return @{ }} + $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } + $centralAdminSite = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" | Where-Object { $_.IsAdministrationWebApplication })[0] + $returnValue = @{ - FarmName = $spFarm.Name + FarmConfigDatabaseName = $spFarm.Name + DatabaseServer = $configDb.Server.Name + FarmAccount = $spFarm.DefaultServiceAccount.Name + InstallAccount = $params.InstallAccount + Passphrase = $params.Passphrase + AdminContentDatabaseName = $centralAdminSite.ContentDatabases[0].Server + CentralAdministrationPort = [Uri]::new($centralAdminSite.Url).Port } return $returnValue } @@ -158,10 +167,9 @@ function Test-TargetResource $CentralAdministrationPort ) - $result = Get-TargetResource @PSBoundParameters - - if ($result.Count -eq 0) { return $false } - return $true + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose "Checking for local farm presence" + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("FarmConfigDatabaseName") } Export-ModuleMember -Function *-TargetResource diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index a3895bd50..5653127e7 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -29,7 +29,6 @@ Describe "xSPCreateFarm" { It "Calls SP Farm to find the local environment settings" { Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter {$CmdletName -eq "Get-SPFarm"} $results = Get-TargetResource @testParams - $results.Count | Should Be 0 Assert-VerifiableMocks } } @@ -42,7 +41,7 @@ Describe "xSPCreateFarm" { It "Passes when local server is in a farm" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - FarmName = "SP_Config" + FarmConfigDatabaseName = "SP_Config" } } Test-TargetResource @testParams | Should Be $true From 1c8afe8e2a3fa97be91401f73499ac8e5241ec58 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 15:41:59 +1000 Subject: [PATCH 07/69] Fixed parameter formatting --- .../MSFT_xSPCacheAccounts.psm1 | 57 +++------- .../MSFT_xSPCreateFarm.psm1 | 102 ++++-------------- 2 files changed, 33 insertions(+), 126 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 index e7b4ccd22..55019b467 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 @@ -4,21 +4,10 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $WebAppUrl, - - [parameter(Mandatory = $true)] - [System.String] - $SuperUserAlias, - - [parameter(Mandatory = $true)] - [System.String] - $SuperReaderAlias, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $SuperUserAlias, + [parameter(Mandatory = $true)] [System.String] $SuperReaderAlias, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting cache accounts for $WebAppUrl" @@ -53,21 +42,10 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $WebAppUrl, - - [parameter(Mandatory = $true)] - [System.String] - $SuperUserAlias, - - [parameter(Mandatory = $true)] - [System.String] - $SuperReaderAlias, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $SuperUserAlias, + [parameter(Mandatory = $true)] [System.String] $SuperReaderAlias, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Setting cache accounts for $WebAppUrl" @@ -102,21 +80,10 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $WebAppUrl, - - [parameter(Mandatory = $true)] - [System.String] - $SuperUserAlias, - - [parameter(Mandatory = $true)] - [System.String] - $SuperReaderAlias, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $SuperUserAlias, + [parameter(Mandatory = $true)] [System.String] $SuperReaderAlias, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $CurrentValues = Get-TargetResource @PSBoundParameters diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 93cb21078..2e74e4235 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -4,33 +4,13 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Passphrase, - - [parameter(Mandatory = $true)] - [System.String] - $AdminContentDatabaseName, - - [parameter(Mandatory = $false)] - [System.UInt32] - $CentralAdministrationPort + [parameter(Mandatory = $true)] [System.String] $FarmConfigDatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseServer, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [System.String] $Passphrase, + [parameter(Mandatory = $true)] [System.String] $AdminContentDatabaseName, + [parameter(Mandatory = $false)] [System.UInt32] $CentralAdministrationPort ) Write-Verbose -Message "Checking for local SP Farm" @@ -66,33 +46,13 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Passphrase, - - [parameter(Mandatory = $true)] - [System.String] - $AdminContentDatabaseName, - - [parameter(Mandatory = $false)] - [System.UInt32] - $CentralAdministrationPort + [parameter(Mandatory = $true)] [System.String] $FarmConfigDatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseServer, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [System.String] $Passphrase, + [parameter(Mandatory = $true)] [System.String] $AdminContentDatabaseName, + [parameter(Mandatory = $false)] [System.UInt32] $CentralAdministrationPort ) if (-not $PSBoundParameters.ContainsKey("CentralAdministrationPort")) { $PSBoundParameters.Add("CentralAdministrationPort", 9999) } @@ -138,33 +98,13 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Passphrase, - - [parameter(Mandatory = $true)] - [System.String] - $AdminContentDatabaseName, - - [parameter(Mandatory = $false)] - [System.UInt32] - $CentralAdministrationPort + [parameter(Mandatory = $true)] [System.String] $FarmConfigDatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseServer, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [System.String] $Passphrase, + [parameter(Mandatory = $true)] [System.String] $AdminContentDatabaseName, + [parameter(Mandatory = $false)] [System.UInt32] $CentralAdministrationPort ) $CurrentValues = Get-TargetResource @PSBoundParameters From fb4a7cd652640d7165568438e43e074f4add36ee Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 15:56:20 +1000 Subject: [PATCH 08/69] Updated get method for xSPDiagnosticLoggingSettings --- .../MSFT_xSPDiagnosticLoggingSettings.psm1 | 309 ++++-------------- ...int.xSPDiagnosticLoggingSettings.Tests.ps1 | 23 +- 2 files changed, 69 insertions(+), 263 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 index 22a1c0297..9b552f8b8 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 @@ -4,81 +4,25 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $LogPath, - - [parameter(Mandatory = $true)] - [System.UInt32] - $LogSpaceInGB, - - [parameter(Mandatory = $false)] - [System.Boolean] - $AppAnalyticsAutomaticUploadEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $CustomerExperienceImprovementProgramEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $DaysToKeepLogs, - - [parameter(Mandatory = $false)] - [System.Boolean] - $DownloadErrorReportingUpdatesEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ErrorReportingAutomaticUploadEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ErrorReportingEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $EventLogFloodProtectionEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionNotifyInterval, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionQuietPeriod, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionThreshold, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionTriggerPeriod, - - [parameter(Mandatory = $false)] - [System.UInt32] - $LogCutInterval, - - [parameter(Mandatory = $false)] - [System.Boolean] - $LogMaxDiskSpaceUsageEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $ScriptErrorReportingDelay, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ScriptErrorReportingEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ScriptErrorReportingRequireAuth, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $LogPath, + [parameter(Mandatory = $true)] [System.UInt32] $LogSpaceInGB, + [parameter(Mandatory = $false)] [System.Boolean] $AppAnalyticsAutomaticUploadEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $CustomerExperienceImprovementProgramEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $DaysToKeepLogs, + [parameter(Mandatory = $false)] [System.Boolean] $DownloadErrorReportingUpdatesEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ErrorReportingAutomaticUploadEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ErrorReportingEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $EventLogFloodProtectionEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionNotifyInterval, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionQuietPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionThreshold, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionTriggerPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $LogCutInterval, + [parameter(Mandatory = $false)] [System.Boolean] $LogMaxDiskSpaceUsageEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $ScriptErrorReportingDelay, + [parameter(Mandatory = $false)] [System.Boolean] $ScriptErrorReportingEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ScriptErrorReportingRequireAuth, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting diagnostic configuration settings" @@ -97,8 +41,8 @@ function Get-TargetResource DownloadErrorReportingUpdatesEnabled = $dc.DownloadErrorReportingUpdatesEnabled DaysToKeepLogs = $dc.DaysToKeepLogs LogMaxDiskSpaceUsageEnabled = $dc.LogMaxDiskSpaceUsageEnabled - LogDiskSpaceUsageGB = $dc.LogDiskSpaceUsageGB - LogLocation = $dc.LogLocation + LogSpaceInGB = $dc.LogDiskSpaceUsageGB + LogPath = $dc.LogLocation LogCutInterval = $dc.LogCutInterval EventLogFloodProtectionEnabled = $dc.EventLogFloodProtectionEnabled EventLogFloodProtectionThreshold = $dc.EventLogFloodProtectionThreshold @@ -110,6 +54,7 @@ function Get-TargetResource ScriptErrorReportingDelay = $dc.ScriptErrorReportingDelay } } + $result.Add("InstallAccount", $InstallAccount) return $result } @@ -119,81 +64,25 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $LogPath, - - [parameter(Mandatory = $true)] - [System.UInt32] - $LogSpaceInGB, - - [parameter(Mandatory = $false)] - [System.Boolean] - $AppAnalyticsAutomaticUploadEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $CustomerExperienceImprovementProgramEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $DaysToKeepLogs, - - [parameter(Mandatory = $false)] - [System.Boolean] - $DownloadErrorReportingUpdatesEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ErrorReportingAutomaticUploadEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ErrorReportingEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $EventLogFloodProtectionEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionNotifyInterval, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionQuietPeriod, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionThreshold, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionTriggerPeriod, - - [parameter(Mandatory = $false)] - [System.UInt32] - $LogCutInterval, - - [parameter(Mandatory = $false)] - [System.Boolean] - $LogMaxDiskSpaceUsageEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $ScriptErrorReportingDelay, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ScriptErrorReportingEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ScriptErrorReportingRequireAuth, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $LogPath, + [parameter(Mandatory = $true)] [System.UInt32] $LogSpaceInGB, + [parameter(Mandatory = $false)] [System.Boolean] $AppAnalyticsAutomaticUploadEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $CustomerExperienceImprovementProgramEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $DaysToKeepLogs, + [parameter(Mandatory = $false)] [System.Boolean] $DownloadErrorReportingUpdatesEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ErrorReportingAutomaticUploadEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ErrorReportingEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $EventLogFloodProtectionEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionNotifyInterval, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionQuietPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionThreshold, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionTriggerPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $LogCutInterval, + [parameter(Mandatory = $false)] [System.Boolean] $LogMaxDiskSpaceUsageEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $ScriptErrorReportingDelay, + [parameter(Mandatory = $false)] [System.Boolean] $ScriptErrorReportingEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ScriptErrorReportingRequireAuth, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Setting diagnostic configuration settings" @@ -216,106 +105,32 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $LogPath, - - [parameter(Mandatory = $true)] - [System.UInt32] - $LogSpaceInGB, - - [parameter(Mandatory = $false)] - [System.Boolean] - $AppAnalyticsAutomaticUploadEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $CustomerExperienceImprovementProgramEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $DaysToKeepLogs, - - [parameter(Mandatory = $false)] - [System.Boolean] - $DownloadErrorReportingUpdatesEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ErrorReportingAutomaticUploadEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ErrorReportingEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $EventLogFloodProtectionEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionNotifyInterval, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionQuietPeriod, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionThreshold, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EventLogFloodProtectionTriggerPeriod, - - [parameter(Mandatory = $false)] - [System.UInt32] - $LogCutInterval, - - [parameter(Mandatory = $false)] - [System.Boolean] - $LogMaxDiskSpaceUsageEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $ScriptErrorReportingDelay, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ScriptErrorReportingEnabled, - - [parameter(Mandatory = $false)] - [System.Boolean] - $ScriptErrorReportingRequireAuth, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $LogPath, + [parameter(Mandatory = $true)] [System.UInt32] $LogSpaceInGB, + [parameter(Mandatory = $false)] [System.Boolean] $AppAnalyticsAutomaticUploadEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $CustomerExperienceImprovementProgramEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $DaysToKeepLogs, + [parameter(Mandatory = $false)] [System.Boolean] $DownloadErrorReportingUpdatesEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ErrorReportingAutomaticUploadEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ErrorReportingEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $EventLogFloodProtectionEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionNotifyInterval, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionQuietPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionThreshold, + [parameter(Mandatory = $false)] [System.UInt32] $EventLogFloodProtectionTriggerPeriod, + [parameter(Mandatory = $false)] [System.UInt32] $LogCutInterval, + [parameter(Mandatory = $false)] [System.Boolean] $LogMaxDiskSpaceUsageEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $ScriptErrorReportingDelay, + [parameter(Mandatory = $false)] [System.Boolean] $ScriptErrorReportingEnabled, + [parameter(Mandatory = $false)] [System.Boolean] $ScriptErrorReportingRequireAuth, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting diagnostic configuration settings" - $result = Get-TargetResource @PSBoundParameters - if ($LogPath -ne $result.LogLocation) { return $false } - if ($LogSpaceInGB -ne $result.LogDiskSpaceUsageGB) { return $false } + $CurrentValues = Get-TargetResource @PSBoundParameters - if ($AppAnalyticsAutomaticUploadEnabled -ne $result.AppAnalyticsAutomaticUploadEnabled) { return $false } - if ($CustomerExperienceImprovementProgramEnabled -ne $result.CustomerExperienceImprovementProgramEnabled) { return $false } - if ($DaysToKeepLogs -ne $result.DaysToKeepLogs) { return $false } - if ($DownloadErrorReportingUpdatesEnabled -ne $result.DownloadErrorReportingUpdatesEnabled) { return $false } - if ($ErrorReportingAutomaticUploadEnabled -ne $result.ErrorReportingAutomaticUploadEnabled) { return $false } - if ($ErrorReportingEnabled -ne $result.ErrorReportingEnabled) { return $false } - if ($EventLogFloodProtectionEnabled -ne $result.EventLogFloodProtectionEnabled) { return $false } - if ($EventLogFloodProtectionNotifyInterval -ne $result.EventLogFloodProtectionNotifyInterval) { return $false } - if ($EventLogFloodProtectionQuietPeriod -ne $result.EventLogFloodProtectionQuietPeriod) { return $false } - if ($EventLogFloodProtectionThreshold -ne $result.EventLogFloodProtectionThreshold) { return $false } - if ($EventLogFloodProtectionTriggerPeriod -ne $result.EventLogFloodProtectionTriggerPeriod) { return $false } - if ($LogCutInterval -ne $result.LogCutInterval) { return $false } - if ($LogMaxDiskSpaceUsageEnabled -ne $result.LogMaxDiskSpaceUsageEnabled) { return $false } - if ($ScriptErrorReportingDelay -ne $result.ScriptErrorReportingDelay) { return $false } - if ($ScriptErrorReportingEnabled -ne $result.ScriptErrorReportingEnabled) { return $false } - if ($ScriptErrorReportingRequireAuth -ne $result.ScriptErrorReportingRequireAuth) { return $false } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters } diff --git a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 index 380fc1715..775cb20b5 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 @@ -27,11 +27,6 @@ Describe "xSPDiagnosticLoggingSettings" { DaysToKeepLogs = 7 LogMaxDiskSpaceUsageEnabled = $true LogCutInterval = 30 - EventLogFloodProtectionEnabled = $true - EventLogFloodProtectionThreshold = 10 - EventLogFloodProtectionTriggerPeriod = 10 - EventLogFloodProtectionQuietPeriod = 10 - EventLogFloodProtectionNotifyInterval = 10 ScriptErrorReportingEnabled = $true ScriptErrorReportingRequireAuth = $true ScriptErrorReportingDelay = 5 @@ -60,17 +55,13 @@ Describe "xSPDiagnosticLoggingSettings" { DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled DaysToKeepLogs = $testParams.DaysToKeepLogs LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled - LogDiskSpaceUsageGB = $testParams.LogSpaceInGB - LogLocation = $testParams.LogPath + LogSpaceInGB = $testParams.LogSpaceInGB + LogPath = $testParams.LogPath LogCutInterval = $testParams.LogCutInterval - EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled - EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold - EventLogFloodProtectionTriggerPeriod = $testParams.EventLogFloodProtectionTriggerPeriod - EventLogFloodProtectionQuietPeriod = $testParams.EventLogFloodProtectionQuietPeriod - EventLogFloodProtectionNotifyInterval = $testParams.EventLogFloodProtectionNotifyInterval ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay + InstallAccount = $null } } Test-TargetResource @testParams | Should Be $true @@ -85,8 +76,8 @@ Describe "xSPDiagnosticLoggingSettings" { DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled DaysToKeepLogs = $testParams.DaysToKeepLogs LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled - LogDiskSpaceUsageGB = $testParams.LogSpaceInGB - LogLocation = "C:\logs" + LogSpaceInGB = $testParams.LogSpaceInGB + LogPath = "C:\logs" LogCutInterval = $testParams.LogCutInterval EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold @@ -110,8 +101,8 @@ Describe "xSPDiagnosticLoggingSettings" { DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled DaysToKeepLogs = $testParams.DaysToKeepLogs LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled - LogDiskSpaceUsageGB = 1 - LogLocation = $testParams.LogPath + LogSpaceInGB = 1 + LogPath = $testParams.LogPath LogCutInterval = $testParams.LogCutInterval EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold From 6ff58e4128d1216fc2476c93830446ce9b1a1ebb Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 19:18:59 +1000 Subject: [PATCH 09/69] Updated get method for xSPDistributedCacheService --- .../MSFT_xSPDistributedCacheService.psm1 | 144 ++++++------------ ...Point.xSPDistributedCacheService.Tests.ps1 | 35 +++-- 2 files changed, 71 insertions(+), 108 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index e2ae57b3e..3ebee75ce 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -4,35 +4,18 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure, - - [parameter(Mandatory = $true)] - [System.UInt32] - $CacheSizeInMB, - - [parameter(Mandatory = $true)] - [System.String] - $ServiceAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.Boolean] - $CreateFirewallRules + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.UInt32] $CacheSizeInMB, + [parameter(Mandatory = $true)] [System.String] $ServiceAccount, + [parameter(Mandatory = $true)] [System.Boolean] $CreateFirewallRules, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting the cache host information" - $result = Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] try { Invoke-xSharePointDCCmdlet -CmdletName "Use-CacheCluster" -ErrorAction SilentlyContinue @@ -43,19 +26,33 @@ function Get-TargetResource ComputerName = $computerName CachePort = $cacheHost.PortNo } -ErrorAction SilentlyContinue - if ($null -eq $cacheHostConfig) { return @{} } - + if ($null -eq $cacheHostConfig) { return @{ + Name = $params.Name + Ensure = "Absent" + InstallAccount = $params.InstallAccount + } } + + $windowsService = Get-WmiObject "win32_service" -Filter "Name='AppFabricCachingService'" + $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -ErrorAction SilentlyContinue + return @{ - HostName = $computerName - Port = $cacheHost.PortNo + Name = $params.Name CacheSizeInMB = $cacheHostConfig.Size + ServiceAccount = $windowsService.StartName + CreateFirewallRules = (-not $firewallRule) + Ensure = "Present" + InstallAccount = $params.InstallAccount } } catch{ - return @{} + return @{ + Name = $params.Name + Ensure = "Absent" + InstallAccount = $params.InstallAccount + } } } - $result + return $result } @@ -64,32 +61,16 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure, - - [parameter(Mandatory = $true)] - [System.UInt32] - $CacheSizeInMB, - - [parameter(Mandatory = $true)] - [System.String] - $ServiceAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.Boolean] - $CreateFirewallRules + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.UInt32] $CacheSizeInMB, + [parameter(Mandatory = $true)] [System.String] $ServiceAccount, + [parameter(Mandatory = $true)] [System.Boolean] $CreateFirewallRules, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) + $CurrentState = Get-TargetResource @PSBoundParameters + if ($Ensure -eq "Present") { Write-Verbose -Message "Adding the distributed cache to the server" if($createFirewallRules) { @@ -100,9 +81,11 @@ function Set-TargetResource } Write-Verbose -Message "Firewall rule added" } - Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { - $params = $args[0] - Add-xSharePointDistributedCacheServer -CacheSizeInMB $params.CacheSizeInMB -ServiceAccount $params.ServiceAccount + if ($CurrentState.Ensure -ne $Ensure) { + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + Add-xSharePointDistributedCacheServer -CacheSizeInMB $params.CacheSizeInMB -ServiceAccount $params.ServiceAccount + } } } else { Write-Verbose -Message "Removing distributed cache to the server" @@ -123,44 +106,17 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure, - - [parameter(Mandatory = $true)] - [System.UInt32] - $CacheSizeInMB, - - [parameter(Mandatory = $true)] - [System.String] - $ServiceAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.Boolean] - $createFirewallRules + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.UInt32] $CacheSizeInMB, + [parameter(Mandatory = $true)] [System.String] $ServiceAccount, + [parameter(Mandatory = $true)] [System.Boolean] $CreateFirewallRules, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters - - if ($Ensure -eq "Present") { - if ($result.Count -eq 0) { return $false } - else { - if ($result.CacheSizeInMB -ne $CacheSizeInMB) { return $false } - } - return $true - } else { - if ($result.Count -eq 0) { return $true } - return $false - } + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose -Message "Testing for distributed cache configuration" + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("CacheSizeInMB", "Ensure", "CreateFirewallRules") } diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 27f880cc3..668432a07 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -37,12 +37,11 @@ Describe "xSPDistributedCacheService" { Size = $testParams.CacheSizeInMB } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-AFCacheHostConfiguration" } + Mock Get-WmiObject { @{ StartName = $testParams.ServiceAccount.UserName } } -Verifiable + Mock Get-NetFirewallRule { @{} } -Verifiable + $result = Get-TargetResource @testParams - $result.HostName | Should Be ([System.Net.Dns]::GetHostByName($env:computerName)).HostName - $result.Port | Should Be 22233 - $result.CacheSizeInMB | Should Be $testParams.CacheSizeInMB - Assert-VerifiableMocks } @@ -65,9 +64,10 @@ Describe "xSPDistributedCacheService" { It "Passes when cache is present and size is correct" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - HostName = $env:COMPUTERNAME - Port = 22233 CacheSizeInMB = $testParams.CacheSizeInMB + ServiceAccount = $testParams.ServiceAccount.UserName + CreateFirewallRules = $testParams.CreateFirewallRules + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $true @@ -75,10 +75,11 @@ Describe "xSPDistributedCacheService" { It "Fails when cache is present but size is not correct" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - HostName = $env:COMPUTERNAME - Port = 22233 CacheSizeInMB = 1 - } + ServiceAccount = $testParams.ServiceAccount.UserName + CreateFirewallRules = $testParams.CreateFirewallRules + Ensure = "Present" + } } Test-TargetResource @testParams | Should Be $false } @@ -88,16 +89,22 @@ Describe "xSPDistributedCacheService" { It "Fails when cache is present but not should be" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - HostName = $env:COMPUTERNAME - Port = 22233 - CacheSizeInMB = 1 - } + CacheSizeInMB = $testParams.CacheSizeInMB + ServiceAccount = $testParams.ServiceAccount.UserName + CreateFirewallRules = $testParams.CreateFirewallRules + Ensure = "Present" + } } Test-TargetResource @testParams | Should Be $false } It "Passes when cache is not present and should not be" { Mock -ModuleName $ModuleName Get-TargetResource { - return @{ } + return @{ + CacheSizeInMB = $testParams.CacheSizeInMB + ServiceAccount = $testParams.ServiceAccount.UserName + CreateFirewallRules = $testParams.CreateFirewallRules + Ensure = "Absent" + } } Test-TargetResource @testParams | Should Be $true } From 1ef78ef62299a6918737ddc9b93ad44b7876405c Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 19:38:28 +1000 Subject: [PATCH 10/69] Updated get method for xSPFeature --- .../MSFT_xSPFeature/MSFT_xSPFeature.psm1 | 27 ++++++------ .../xSharePoint.xSPFeature.Tests.ps1 | 44 +++++-------------- 2 files changed, 26 insertions(+), 45 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 index 79740efbd..0c9e1c34d 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 @@ -34,7 +34,13 @@ function Get-TargetResource $feature = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFeature" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue - if ($null -eq $feature) { return @{} } + if ($null -eq $feature) { return @{ + Name = $params.Name + FeatureScope = $params.FeatureScope + Url = $params.Url + InstalAcount = $params.InstallAccount + Ensure = "Absent" + } } $checkParams = @{} $checkParams.Add("Identity", $params.Name) @@ -45,12 +51,14 @@ function Get-TargetResource } $featureAtScope = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFeature" -Arguments $checkParams -ErrorAction SilentlyContinue $enabled = ($null -ne $featureAtScope) + if ($enabled) { $currentState = "Present" } else { $currentState = "Absent" } return @{ Name = $params.Name - Id = $feature.Id - Version = $feature.Version - Enabled = $enabled + FeatureScope = $params.FeatureScope + Url = $params.Url + InstalAcount = $params.InstallAccount + Ensure = $currentState } } return $result @@ -133,15 +141,8 @@ function Test-TargetResource $Ensure ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for feature $Name at $FeatureScope scope" - - if ($result.Count -eq 0) { - throw "Unable to locate feature '$Name' in the current SharePoint farm, check that the name is correct and that the feature has been deployed to the file system." - } else { - if ($Ensure -eq "Present" -and $result.Enabled -eq $false) { return $false } - if ($Ensure -eq "Absent" -and $result.Enabled -eq $true) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure") } Export-ModuleMember -Function *-TargetResource diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index 826569e6b..ce4a166b3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -37,7 +37,7 @@ Describe "xSPFeature" { $result = Get-TargetResource @testParams - $result.Enabled | Should be $false + $result.Ensure | Should be "Absent" Assert-VerifiableMocks } @@ -48,7 +48,7 @@ Describe "xSPFeature" { $result = Get-TargetResource @testParams - $result.Enabled | Should be $false + $result.Ensure | Should be "Absent" Assert-VerifiableMocks } @@ -58,7 +58,7 @@ Describe "xSPFeature" { $result = Get-TargetResource @testParams - $result.Enabled | Should be $true + $result.Ensure | Should be "Present" Assert-VerifiableMocks } @@ -69,24 +69,18 @@ Describe "xSPFeature" { $result = Get-TargetResource @testParams - $result.Enabled | Should be $true + $result.Ensure | Should be "Present" Assert-VerifiableMocks } } Context "Validate test method" { - It "Throws when a feature is not installed in the farm" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } - { Test-TargetResource @testParams } | Should Throw "Unable to locate feature" - } It "Passes when a farm feature is enabaled and should be" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $true + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $true @@ -95,9 +89,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $false + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $false @@ -109,9 +101,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $false + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $true @@ -120,9 +110,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $true + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $false @@ -135,9 +123,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $true + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $true @@ -146,9 +132,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $false + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $false @@ -160,9 +144,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $false + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $true @@ -171,9 +153,7 @@ Describe "xSPFeature" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Id = [Guid]::NewGuid() - Version = "1.0" - Enabled = $true + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $false From ad672541cad6d069cf669fb55042712d546dfb82 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 19:52:01 +1000 Subject: [PATCH 11/69] Updated get method for xSPJoinFarm module --- .../MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 | 77 ++++++------------- .../xSharePoint.xSPJoinFarm.Tests.ps1 | 3 +- 2 files changed, 25 insertions(+), 55 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 index fb21af151..f331e358b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 @@ -4,26 +4,16 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Passphrase + [parameter(Mandatory = $true)] [System.String] $FarmConfigDatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseServer, + [parameter(Mandatory = $true)] [System.String] $Passphrase, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Checking for local SP Farm" - $result = Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { + $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] try { $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" -ErrorAction SilentlyContinue } catch { @@ -32,10 +22,14 @@ function Get-TargetResource if ($null -eq $spFarm) {return @{ }} - $returnValue = @{ - FarmName = $spFarm.Name + $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } + + return @{ + FarmConfigDatabaseName = $spFarm.Name + DatabaseServer = $configDb.Server.Name + InstallAccount = $params.InstallAccount + Passphrase = $params.Passphrase } - return $returnValue } return $result } @@ -46,21 +40,10 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Passphrase + [parameter(Mandatory = $true)] [System.String] $FarmConfigDatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseServer, + [parameter(Mandatory = $true)] [System.String] $Passphrase, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Joining existing farm configuration database" @@ -114,27 +97,15 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $FarmConfigDatabaseName, - - [parameter(Mandatory = $true)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Passphrase + [parameter(Mandatory = $true)] [System.String] $FarmConfigDatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseServer, + [parameter(Mandatory = $true)] [System.String] $Passphrase, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters - - if ($result.Count -eq 0) { return $false } - return $true + $CurrentValues = Get-TargetResource @PSBoundParameters + Write-Verbose "Checking for local farm presence" + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("FarmConfigDatabaseName") } diff --git a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 index b5b00ac27..2600e602c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 @@ -26,7 +26,6 @@ Describe "xSPJoinFarm" { It "Calls SP Farm to find the local environment settings" { Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter {$CmdletName -eq "Get-SPFarm"} $results = Get-TargetResource @testParams - $results.Count | Should Be 0 Assert-VerifiableMocks } } @@ -39,7 +38,7 @@ Describe "xSPJoinFarm" { It "Passes when local server is in a farm" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - FarmName = "SP_Config" + FarmConfigDatabaseName = "SP_Config" } } Test-TargetResource @testParams | Should Be $true From 555cfa29b800e1f75a17521f060a26dbe9f335f7 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 19:54:55 +1000 Subject: [PATCH 12/69] Formatted parameter list --- .../MSFT_xSPFeature/MSFT_xSPFeature.psm1 | 78 ++++--------------- 1 file changed, 15 insertions(+), 63 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 index 0c9e1c34d..270e98904 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 @@ -4,27 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [ValidateSet("Farm","WebApplication","Site","Web")] - [System.String] - $FeatureScope, - - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) Write-Verbose -Message "Getting feature $Name at $FeatureScope scope" @@ -70,27 +54,11 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [ValidateSet("Farm","WebApplication","Site","Web")] - [System.String] - $FeatureScope, - - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { @@ -118,27 +86,11 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [ValidateSet("Farm","WebApplication","Site","Web")] - [System.String] - $FeatureScope, - - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) $CurrentValues = Get-TargetResource @PSBoundParameters From 1ad5ede7f501d631cb28b844c8e2e1a2cb210a02 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 20:20:16 +1000 Subject: [PATCH 13/69] Updated get method for xSPFeature --- .../MSFT_xSPFeature/MSFT_xSPFeature.psm1 | 6 +- .../MSFT_xSPManagedAccount.psm1 | 108 ++++-------------- .../xSharePoint.xSPManagedAccount.Tests.ps1 | 24 ++-- 3 files changed, 38 insertions(+), 100 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 index 270e98904..19216abd2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 @@ -5,7 +5,7 @@ function Get-TargetResource param ( [parameter(Mandatory = $true)] [System.String] $Name, - [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [System.String] $Url, [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure @@ -55,7 +55,7 @@ function Set-TargetResource param ( [parameter(Mandatory = $true)] [System.String] $Name, - [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [System.String] $Url, [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure @@ -87,7 +87,7 @@ function Test-TargetResource param ( [parameter(Mandatory = $true)] [System.String] $Name, - [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [System.String] $Url, [parameter(Mandatory = $true)] [ValidateSet("Farm","WebApplication","Site","Web")] [System.String] $FeatureScope, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 index e499c772d..72491d946 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 @@ -4,29 +4,12 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Account, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EmailNotification, - - [parameter(Mandatory = $false)] - [System.UInt32] - $PreExpireDays, - - [parameter(Mandatory = $false)] - [System.String] - $Schedule, - - [parameter(Mandatory = $true)] - [System.String] - $AccountName + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $Account, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $false)] [System.UInt32] $EmailNotification, + [parameter(Mandatory = $false)] [System.UInt32] $PreExpireDays, + [parameter(Mandatory = $false)] [System.String] $Schedule, + [parameter(Mandatory = $true)] [System.String] $AccountName ) Write-Verbose -Message "Checking for managed account $AccountName" @@ -39,10 +22,11 @@ function Get-TargetResource if ($null -eq $ma) { return @{ } } return @{ AccountName = $ma.Userame - AutomaticChange = $ma.AutomaticChange - DaysBeforeChangeToEmail = $ma.DaysBeforeChangeToEmail - DaysBeforeExpiryToChange = $ma.DaysBeforeExpiryToChange - ChangeSchedule = $ma.ChangeSchedule + EmailNotification = $ma.DaysBeforeChangeToEmail + PreExpireDays = $ma.DaysBeforeExpiryToChange + Schedule = $ma.ChangeSchedule + Account = $params.Account + InstallAccount = $params.InstallAccount } } catch { return @{ } @@ -56,29 +40,12 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Account, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EmailNotification, - - [parameter(Mandatory = $false)] - [System.UInt32] - $PreExpireDays, - - [parameter(Mandatory = $false)] - [System.String] - $Schedule, - - [parameter(Mandatory = $true)] - [System.String] - $AccountName + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $Account, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $false)] [System.UInt32] $EmailNotification, + [parameter(Mandatory = $false)] [System.UInt32] $PreExpireDays, + [parameter(Mandatory = $false)] [System.String] $Schedule, + [parameter(Mandatory = $true)] [System.String] $AccountName ) Write-Verbose -Message "Setting managed account $AccountName" @@ -109,42 +76,17 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Account, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $false)] - [System.UInt32] - $EmailNotification, - - [parameter(Mandatory = $false)] - [System.UInt32] - $PreExpireDays, - - [parameter(Mandatory = $false)] - [System.String] - $Schedule, - - [parameter(Mandatory = $true)] - [System.String] - $AccountName + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $Account, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $false)] [System.UInt32] $EmailNotification, + [parameter(Mandatory = $false)] [System.UInt32] $PreExpireDays, + [parameter(Mandatory = $false)] [System.String] $Schedule, + [parameter(Mandatory = $true)] [System.String] $AccountName ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing managed account $AccountName" - if ($result.Count -eq 0) { return $false } - else { - if($result.AutomaticChange -eq $true) { - if($result.ChangeSchedule -ne $Schedule) { return $false } - if($result.DaysBeforeExpiryToChange -ne $PreExpireDays) { return $false } - if($result.DaysBeforeChangeToEmail -ne $EmailNotification) { return $false } - } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Schedule","PreExpireDays","EmailNotification") } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 index 42f4d2dd0..350029685 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 @@ -30,7 +30,6 @@ Describe "xSPManagedAccount" { Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPManagedAccount" -and $Arguments.Identity -eq $testParams.Account.UserName } $results = Get-TargetResource @testParams - $results.Count | Should Be 0 Assert-VerifiableMocks } @@ -45,10 +44,9 @@ Describe "xSPManagedAccount" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ AccountName = $testParams.AccountName - AutomaticChange = $false - DaysBeforeChangeToEmail = $testParams.EmailNotification - DaysBeforeExpiryToChange = $testParams.PreExpireDays - ChangeSchedule = $testParams.Schedule + EmailNotification = $testParams.EmailNotification + PreExpireDays = $testParams.PreExpireDays + Schedule = $testParams.Schedule } } Test-TargetResource @testParams | Should Be $true @@ -57,10 +55,9 @@ Describe "xSPManagedAccount" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ AccountName = $testParams.AccountName - AutomaticChange = $true - DaysBeforeChangeToEmail = $testParams.EmailNotification - DaysBeforeExpiryToChange = $testParams.PreExpireDays - ChangeSchedule = "Weekly Friday between 01:00 and 02:00" + EmailNotification = $testParams.EmailNotification + PreExpireDays = $testParams.PreExpireDays + Schedule = "Weekly Friday between 01:00 and 02:00" } } Test-TargetResource @testParams | Should Be $false @@ -69,10 +66,9 @@ Describe "xSPManagedAccount" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ AccountName = $testParams.AccountName - AutomaticChange = $true - DaysBeforeChangeToEmail = 0 - DaysBeforeExpiryToChange = 0 - ChangeSchedule = $testParams.Schedule + EmailNotification = 0 + PreExpireDays = 0 + Schedule = $testParams.Schedule } } Test-TargetResource @testParams | Should Be $false @@ -92,7 +88,7 @@ Describe "xSPManagedAccount" { It "Modifies an existing account where it already exists" { Mock Get-TargetResource { return @{} AccountName = $testParams.Account.UserName - ChangeSchedule = $testParams.Schedule + Schedule = $testParams.Schedule } Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPManagedAccount" } From 60108a3ad886d00e4aac22aaad44b33b9048205f Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 20:40:39 +1000 Subject: [PATCH 14/69] Updated get method in xSPManagedMetaDataServiceApp --- .../MSFT_xSPManagedMetaDataServiceApp.psm1 | 86 +++++-------------- 1 file changed, 20 insertions(+), 66 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 index 5db30c1a6..f43e09460 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 @@ -4,32 +4,17 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting managed metadata service application $Name" $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - try { $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName MMS @@ -43,6 +28,9 @@ function Get-TargetResource return @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name + DatabaseName = $serviceApp.Database.Name + DatabaseServer = $serviceApp.Database.Server.Name + InstallAccount = $params.InstallAccount } } } @@ -60,25 +48,11 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $result = Get-TargetResource @PSBoundParameters @@ -127,36 +101,16 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters - + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for Managed Metadata Service Application '$Name'" - if ($result.Count -eq 0) { return $false } - else { - if ([string]::IsNullOrEmpty($ApplicationPool) -eq $false -and $ApplicationPool -ne $result.ApplicationPool) { return $false } - } - return $true - + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } From 182e1acb6108d10f92d4f84ac123d7e06d48bccd Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 21:10:40 +1000 Subject: [PATCH 15/69] Updated get method of xSPManagedPath resource --- .../MSFT_xSPManagedPath.psm1 | 92 +++++-------------- .../xSharePoint.xSPManagedPath.Tests.ps1 | 12 ++- 2 files changed, 30 insertions(+), 74 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 index a7ecc7ff8..c7312d2bb 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 @@ -4,25 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $WebAppUrl, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $RelativeUrl, - - [parameter(Mandatory = $true)] - [System.Boolean] - $Explicit, - - [parameter(Mandatory = $true)] - [System.Boolean] - $HostHeader + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $RelativeUrl, + [parameter(Mandatory = $true)] [System.Boolean] $Explicit, + [parameter(Mandatory = $true)] [System.Boolean] $HostHeader, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Looking up the managed path $RelativeUrl in $WebAppUrl" @@ -39,8 +25,11 @@ function Get-TargetResource if ($null -eq $path) { return @{} } return @{ - Name = $path.Name - PathType = $path.Type + RelativeUrl = $path.Name + Explicit = ($path.Type -eq "ExplicitInclusion") + WebAppUrl = $params.WebAppUrl + HostHeader = $params.HostHeader + InstallAccount = $params.InstallAccount } } return $result @@ -52,25 +41,11 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $WebAppUrl, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $RelativeUrl, - - [parameter(Mandatory = $true)] - [System.Boolean] - $Explicit, - - [parameter(Mandatory = $true)] - [System.Boolean] - $HostHeader + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $RelativeUrl, + [parameter(Mandatory = $true)] [System.Boolean] $Explicit, + [parameter(Mandatory = $true)] [System.Boolean] $HostHeader, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating the managed path $RelativeUrl in $WebAppUrl" @@ -103,39 +78,16 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $WebAppUrl, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [System.String] - $RelativeUrl, - - [parameter(Mandatory = $true)] - [System.Boolean] - $Explicit, - - [parameter(Mandatory = $true)] - [System.Boolean] - $HostHeader + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $RelativeUrl, + [parameter(Mandatory = $true)] [System.Boolean] $Explicit, + [parameter(Mandatory = $true)] [System.Boolean] $HostHeader, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Looking up the managed path $RelativeUrl in $WebAppUrl" - if ($result.Count -eq 0) { return $false } - else { - if ($Explicit) { - if ($result.PathType -ne "ExplicitInclusion") { return $false } - } - else { - if ($result.PathType -ne "WildcardInclusion") { return $false } - } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("WebAppUrl","RelativeUrl","Explicit","HostHeader") } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 index 2006f5b35..a73f3f4bc 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 @@ -39,8 +39,10 @@ Describe "xSPManagedPath" { It "Passes when the path is found and is the correct type" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - Name = $testParams.RelativeUrl - PathType = "WildcardInclusion" + RelativeUrl = $testParams.RelativeUrl + Explicit = $testParams.Explicit + HostHeader = $testParams.HostHeader + WebAppUrl = $testParams.WebAppUrl } } Test-TargetResource @testParams | Should Be $true @@ -48,8 +50,10 @@ Describe "xSPManagedPath" { It "Fails when the path is found and is not the correct type" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - Name = $testParams.RelativeUrl - PathType = "ExplicitInclusion" + RelativeUrl = $testParams.RelativeUrl + Explicit = (-not $testParams.Explicit) + HostHeader = $testParams.HostHeader + WebAppUrl = $testParams.WebAppUrl } } Test-TargetResource @testParams | Should Be $false From 1fe19fea60d5f7f7cd47ea95ccdbbe842326ced3 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 21:31:27 +1000 Subject: [PATCH 16/69] Updated get method for xSPSearchServivceApp --- .../MSFT_xSPSearchServiceApp.psm1 | 84 +++++-------------- 1 file changed, 20 insertions(+), 64 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 index 9cb559df7..04a63ca48 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 @@ -4,25 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting Search service application '$Name'" @@ -41,6 +27,9 @@ function Get-TargetResource return @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name + DatabaseName = $serviceApp.Database.Name + DatabaseServer = $serviceApp.Database.Server.Name + InstallAccount = $params.InstallAccount } } } @@ -53,25 +42,11 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $result = Get-TargetResource @PSBoundParameters @@ -116,35 +91,16 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing Search service application '$Name'" - - if ($result.Count -eq 0) { return $false } - else { - if ($ApplicationPool -ne $result.ApplicationPool) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } Export-ModuleMember -Function *-TargetResource From b0cf7fa83eba8af73b3dd23259242d5cb2db3df7 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 22:27:08 +1000 Subject: [PATCH 17/69] Fixed get method for xSPSecureStoreServiceApp --- .../MSFT_xSPSecureStoreServiceApp.psm1 | 203 ++++-------------- 1 file changed, 44 insertions(+), 159 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 index ade2522b2..66c43cf81 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 @@ -4,57 +4,19 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.Boolean] - $AuditingEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $AuditlogMaxSize, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $DatabaseCredentials, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabasePassword, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseUsername, - - [parameter(Mandatory = $false)] - [System.String] - $FailoverDatabaseServer, - - [parameter(Mandatory = $false)] - [System.Boolean] - $PartitionMode, - - [parameter(Mandatory = $false)] - [System.Boolean] - $Sharing, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.Boolean] $AuditingEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $AuditlogMaxSize, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabasePassword, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseUsername, + [parameter(Mandatory = $false)] [System.String] $FailoverDatabaseServer, + [parameter(Mandatory = $false)] [System.Boolean] $PartitionMode, + [parameter(Mandatory = $false)] [System.Boolean] $Sharing, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting secure store service application '$Name'" @@ -73,6 +35,9 @@ function Get-TargetResource return @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name + DatabaseName = $serviceApp.Database.Name + DatabaseServer = $serviceApp.Database.Server.Name + InstallAccount = $params.InstallAccount } } } @@ -85,57 +50,19 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.Boolean] - $AuditingEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $AuditlogMaxSize, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $DatabaseCredentials, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabasePassword, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseUsername, - - [parameter(Mandatory = $false)] - [System.String] - $FailoverDatabaseServer, - - [parameter(Mandatory = $false)] - [System.Boolean] - $PartitionMode, - - [parameter(Mandatory = $false)] - [System.Boolean] - $Sharing, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.Boolean] $AuditingEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $AuditlogMaxSize, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabasePassword, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseUsername, + [parameter(Mandatory = $false)] [System.String] $FailoverDatabaseServer, + [parameter(Mandatory = $false)] [System.Boolean] $PartitionMode, + [parameter(Mandatory = $false)] [System.Boolean] $Sharing, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) $result = Get-TargetResource @PSBoundParameters @@ -177,66 +104,24 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.Boolean] - $AuditingEnabled, - - [parameter(Mandatory = $false)] - [System.UInt32] - $AuditlogMaxSize, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $DatabaseCredentials, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabasePassword, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseUsername, - - [parameter(Mandatory = $false)] - [System.String] - $FailoverDatabaseServer, - - [parameter(Mandatory = $false)] - [System.Boolean] - $PartitionMode, - - [parameter(Mandatory = $false)] - [System.Boolean] - $Sharing, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.Boolean] $AuditingEnabled, + [parameter(Mandatory = $false)] [System.UInt32] $AuditlogMaxSize, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabasePassword, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseUsername, + [parameter(Mandatory = $false)] [System.String] $FailoverDatabaseServer, + [parameter(Mandatory = $false)] [System.Boolean] $PartitionMode, + [parameter(Mandatory = $false)] [System.Boolean] $Sharing, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing secure store service application $Name" - if ($result.Count -eq 0) { return $false } - else { - if ($ApplicationPool -ne $result.ApplicationPool) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } From bb94cab9b1636a468e8b99ea4ddf35370891f878 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 22:38:02 +1000 Subject: [PATCH 18/69] Fixed get method for xSPServiceAppPool --- .../MSFT_xSPServiceAppPool.psm1 | 53 +++++-------------- .../xSharePoint.xSPServiceAppPool.Tests.ps1 | 4 +- 2 files changed, 15 insertions(+), 42 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 index a6be54868..6144d43ff 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 @@ -4,17 +4,9 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ServiceAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ServiceAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting service application pool '$Name'" @@ -27,7 +19,8 @@ function Get-TargetResource return @{ Name = $sap.Name - ProcessAccountName = $sap.ProcessAccountName + ServiceAccount = $sap.ProcessAccountName + InstallAccount = $params.InstallAccount } } return $result @@ -39,17 +32,9 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ServiceAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ServiceAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating service application pool '$Name'" @@ -81,26 +66,14 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ServiceAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ServiceAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing service application pool '$Name'" - if ($result.Count -eq 0) { return $false } - else { - if ($ServiceAccount -ne $result.ProcessAccountName) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ServiceAccount") } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 index 2a7a61138..e15a63fd9 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 @@ -38,7 +38,7 @@ Describe "xSPServiceAppPool" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - ProcessAccountName = $testParams.ServiceAccount + ServiceAccount = $testParams.ServiceAccount } } Test-TargetResource @testParams | Should Be $true @@ -47,7 +47,7 @@ Describe "xSPServiceAppPool" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - ProcessAccountName = "Wrong account name" + ServiceAccount = "Wrong account name" } } Test-TargetResource @testParams | Should Be $false From 96e43a6007a68cb38646ce4e0b5dd20259bf6dde Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 22:56:49 +1000 Subject: [PATCH 19/69] Fixed get method of xSPServiceInstance --- .../MSFT_xSPServiceInstance.psm1 | 64 +++++-------------- .../xSharePoint.xSPServiceInstance.Tests.ps1 | 8 +-- 2 files changed, 19 insertions(+), 53 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 index afb70bb9e..0ac188d47 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 @@ -4,18 +4,9 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) Write-Verbose -Message "Getting service instance '$Name'" @@ -25,13 +16,15 @@ function Get-TargetResource $si = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq $params.Name } if ($null -eq $si) { return @{} } + if ($si.Status) { $localEnsure = "Present" } else { $localEnsure = "Absent" } return @{ Name = $params.Name - Status = $si.Status + Ensure = $localEnsure + InstallAccount = $params.InstallAccount } } - $result + return $result } @@ -40,18 +33,9 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) if ($Ensure -eq "Present") { @@ -84,32 +68,14 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Getting service instance '$Name'" - if ($result.Count -eq 0) { return $false } - else { - if ($Ensure -eq "Present" -and $result.Status -eq "Disabled") { - return $false - } - if ($Ensure -eq "Absent" -and $result.Status -eq "Online") { - return $false - } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name", "Ensure") } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 index ecd03de99..612c9b64b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 @@ -38,7 +38,7 @@ Describe "xSPServiceInstance" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Status = "Online" + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $true @@ -47,7 +47,7 @@ Describe "xSPServiceInstance" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Status = "Disabled" + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $false @@ -59,7 +59,7 @@ Describe "xSPServiceInstance" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Status = "Online" + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $false @@ -68,7 +68,7 @@ Describe "xSPServiceInstance" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ Name = $testParams.Name - Status = "Disabled" + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $true From 6b0eaf2a180f3893ff9c644f3d6e30d33c409dbe Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Mon, 14 Sep 2015 23:50:00 +1000 Subject: [PATCH 20/69] Fixed get method in xSPSite --- .../MSFT_xSPSite/MSFT_xSPSite.psm1 | 255 ++++++------------ .../xSharePoint/xSharePoint.xSPSite.Tests.ps1 | 2 +- 2 files changed, 82 insertions(+), 175 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 index ca07f0035..38172102e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 @@ -4,61 +4,20 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $true)] - [System.String] - $OwnerAlias, - - [parameter(Mandatory = $false)] - [System.UInt32] - $CompatibilityLevel, - - [parameter(Mandatory = $false)] - [System.String] - $ContentDatabase, - - [parameter(Mandatory = $false)] - [System.String] - $Description, - - [parameter(Mandatory = $false)] - [System.String] - $HostHeaderWebApplication, - - [parameter(Mandatory = $false)] - [System.UInt32] - $Language, - - [parameter(Mandatory = $false)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.String] - $OwnerEmail, - - [parameter(Mandatory = $false)] - [System.String] - $QuotaTemplate, - - [parameter(Mandatory = $false)] - [System.String] - $SecondaryEmail, - - [parameter(Mandatory = $false)] - [System.String] - $SecondaryOwnerAlias, - - [parameter(Mandatory = $false)] - [System.String] - $Template, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [System.String] $OwnerAlias, + [parameter(Mandatory = $false)] [System.UInt32] $CompatibilityLevel, + [parameter(Mandatory = $false)] [System.String] $ContentDatabase, + [parameter(Mandatory = $false)] [System.String] $Description, + [parameter(Mandatory = $false)] [System.String] $HostHeaderWebApplication, + [parameter(Mandatory = $false)] [System.UInt32] $Language, + [parameter(Mandatory = $false)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.String] $OwnerEmail, + [parameter(Mandatory = $false)] [System.String] $QuotaTemplate, + [parameter(Mandatory = $false)] [System.String] $SecondaryEmail, + [parameter(Mandatory = $false)] [System.String] $SecondaryOwnerAlias, + [parameter(Mandatory = $false)] [System.String] $Template, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting site collection $Url" @@ -66,16 +25,50 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] $site = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPSite" -Arguments @{ Identity = $params.Url } -ErrorAction SilentlyContinue - + if ($null -eq $site) { return @{} } else { + if ($site.HostHeaderIsSiteName) { $HostHeaderWebApplication = $site.Url } + + if ($site.Owner.UserLogin.Contains("#")) { + # Claims based authentication user + $owner = Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.Owner.UserLogin; IdentityType = "EncodedClaim" } + } else { + # Classic authentication user + $owner = $site.Owner.UserLogin + } + + if ($null -eq $site.SecondaryContact) { + $secondaryOwner = $null + } else { + if ($site.SecondaryContact.UserLogin.Contains("#")) { + # Claims based authentication user + $secondaryOwner = Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.SecondaryContact.UserLogin; IdentityType = "EncodedClaim" } + } else { + # Classic authentication user + $secondaryOwner = $site.SecondaryContact.UserLogin + } + } + return @{ Url = $site.Url - OwnerAlias = $site.OwnerAlias + OwnerAlias = $owner + CompatibilityLevel = $site.CompatibilityLevel + ContentDatabase = $site.ContentDatabase.Name + Description = $site.RootWeb.Description + HostHeaderWebApplication = $HostHeaderWebApplication + Language = $site.RootWeb.Language + Name = $site.RootWeb.Name + OwnerEmail = $site.Owner.Email + QuotaTemplate = $site.Quota + SecondaryEmail = $site.SecondaryContact.Email + SecondaryOwnerAlias = $secondaryOwner + Template = "$($site.RootWeb.WebTemplate)#$($site.RootWeb.WebTemplateId)" + InstallAccount = $params.InstallAccount } } } - $result + return $result } @@ -84,61 +77,20 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $true)] - [System.String] - $OwnerAlias, - - [parameter(Mandatory = $false)] - [System.UInt32] - $CompatibilityLevel, - - [parameter(Mandatory = $false)] - [System.String] - $ContentDatabase, - - [parameter(Mandatory = $false)] - [System.String] - $Description, - - [parameter(Mandatory = $false)] - [System.String] - $HostHeaderWebApplication, - - [parameter(Mandatory = $false)] - [System.UInt32] - $Language, - - [parameter(Mandatory = $false)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.String] - $OwnerEmail, - - [parameter(Mandatory = $false)] - [System.String] - $QuotaTemplate, - - [parameter(Mandatory = $false)] - [System.String] - $SecondaryEmail, - - [parameter(Mandatory = $false)] - [System.String] - $SecondaryOwnerAlias, - - [parameter(Mandatory = $false)] - [System.String] - $Template, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [System.String] $OwnerAlias, + [parameter(Mandatory = $false)] [System.UInt32] $CompatibilityLevel, + [parameter(Mandatory = $false)] [System.String] $ContentDatabase, + [parameter(Mandatory = $false)] [System.String] $Description, + [parameter(Mandatory = $false)] [System.String] $HostHeaderWebApplication, + [parameter(Mandatory = $false)] [System.UInt32] $Language, + [parameter(Mandatory = $false)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.String] $OwnerEmail, + [parameter(Mandatory = $false)] [System.String] $QuotaTemplate, + [parameter(Mandatory = $false)] [System.String] $SecondaryEmail, + [parameter(Mandatory = $false)] [System.String] $SecondaryOwnerAlias, + [parameter(Mandatory = $false)] [System.String] $Template, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating site collection $Url" @@ -162,70 +114,25 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $true)] - [System.String] - $OwnerAlias, - - [parameter(Mandatory = $false)] - [System.UInt32] - $CompatibilityLevel, - - [parameter(Mandatory = $false)] - [System.String] - $ContentDatabase, - - [parameter(Mandatory = $false)] - [System.String] - $Description, - - [parameter(Mandatory = $false)] - [System.String] - $HostHeaderWebApplication, - - [parameter(Mandatory = $false)] - [System.UInt32] - $Language, - - [parameter(Mandatory = $false)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.String] - $OwnerEmail, - - [parameter(Mandatory = $false)] - [System.String] - $QuotaTemplate, - - [parameter(Mandatory = $false)] - [System.String] - $SecondaryEmail, - - [parameter(Mandatory = $false)] - [System.String] - $SecondaryOwnerAlias, - - [parameter(Mandatory = $false)] - [System.String] - $Template, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $true)] [System.String] $OwnerAlias, + [parameter(Mandatory = $false)] [System.UInt32] $CompatibilityLevel, + [parameter(Mandatory = $false)] [System.String] $ContentDatabase, + [parameter(Mandatory = $false)] [System.String] $Description, + [parameter(Mandatory = $false)] [System.String] $HostHeaderWebApplication, + [parameter(Mandatory = $false)] [System.UInt32] $Language, + [parameter(Mandatory = $false)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.String] $OwnerEmail, + [parameter(Mandatory = $false)] [System.String] $QuotaTemplate, + [parameter(Mandatory = $false)] [System.String] $SecondaryEmail, + [parameter(Mandatory = $false)] [System.String] $SecondaryOwnerAlias, + [parameter(Mandatory = $false)] [System.String] $Template, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing site collection $Url" - if ($result.Count -eq 0) { return $false } - else { - - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Url") } diff --git a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 index b678bccf3..88a5af60d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 @@ -23,7 +23,7 @@ Describe "xSPSite" { Context "Validate get method" { It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPSite" } + Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPSite" } Get-TargetResource @testParams Assert-VerifiableMocks } From 391f8d01be6aac87ba2f57db9d18494d730dbc72 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 00:03:13 +1000 Subject: [PATCH 21/69] Fixed get method in xSPStateServiceApp --- .../MSFT_xSPStateServiceApp.psm1 | 84 +++++-------------- 1 file changed, 22 insertions(+), 62 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 index afaa8bcd8..c51a3abc8 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 @@ -4,25 +4,11 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $DatabaseCredentials, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting state service application '$Name'" @@ -35,10 +21,13 @@ function Get-TargetResource if ($null -eq $app) { return @{} } return @{ - Name = $app.DisplayName + Name = $serviceApp.DisplayName + DatabaseName = $serviceApp.Database.Name + DatabaseServer = $serviceApp.Database.Server.Name + InstallAccount = $params.InstallAccount } } - $result + return $result } @@ -47,25 +36,11 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $DatabaseCredentials, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating state service application $Name" @@ -95,31 +70,16 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $DatabaseCredentials, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource -Name $Name -InstallAccount $InstallAccount + $CurrentValues = Get-TargetResource -Name $Name -InstallAccount $InstallAccount Write-Verbose -Message "Testing for state service application $Name" - if ($result.Count -eq 0) { return $false } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name") } From cd1a749aae52d80da136d6bc7a05718af0cd7641 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 00:23:36 +1000 Subject: [PATCH 22/69] Fixed get method in xSPUsageApplication --- .../MSFT_xSPUsageApplication.psm1 | 183 ++++-------------- .../xSharePoint.xSPusageApplication.Tests.ps1 | 22 +-- 2 files changed, 54 insertions(+), 151 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 index 8c690384f..9b69fe7ca 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 @@ -4,49 +4,17 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabasePassword, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseUsername, - - [parameter(Mandatory = $false)] - [System.String] - $FailoverDatabaseServer, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogCutTime, - - [parameter(Mandatory = $false)] - [System.String] - $UsageLogLocation, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogMaxFileSizeKB, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogMaxSpaceGB + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabasePassword, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseUsername, + [parameter(Mandatory = $false)] [System.String] $FailoverDatabaseServer, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogCutTime, + [parameter(Mandatory = $false)] [System.String] $UsageLogLocation, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogMaxFileSizeKB, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogMaxSpaceGB ) Write-Verbose -Message "Getting usage application '$Name'" @@ -65,9 +33,15 @@ function Get-TargetResource $service = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPUsageService" return @{ Name = $serviceApp.DisplayName + InstallAccount = $params.InstallAccount + DatabaseName = $serviceApp.Applications.UsageDatabase.Name + DatabaseServer = $serviceApp.Applications.UsageDatabase.Server.Name + DatabasePassword = $serviceApp.Applications.UsageDatabase.Password + DatabaseUsername = $serviceApp.Applications.UsageDatabase.Username + FailoverDatabaseServer = $serviceApp.Applications.UsageDatabase.FailoverServer UsageLogCutTime = $service.UsageLogCutTime - UsageLogDir = $service.UsageLogDir - UsageLogMaxFileSize = $service.UsageLogMaxFileSize + UsageLogLocation = $service.UsageLogDir + UsageLogMaxFileSizeKB = $service.UsageLogMaxFileSize UsageLogMaxSpaceGB = $service.UsageLogMaxSpaceGB } } @@ -81,49 +55,17 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabasePassword, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseUsername, - - [parameter(Mandatory = $false)] - [System.String] - $FailoverDatabaseServer, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogCutTime, - - [parameter(Mandatory = $false)] - [System.String] - $UsageLogLocation, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogMaxFileSizeKB, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogMaxSpaceGB + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabasePassword, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseUsername, + [parameter(Mandatory = $false)] [System.String] $FailoverDatabaseServer, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogCutTime, + [parameter(Mandatory = $false)] [System.String] $UsageLogLocation, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogMaxFileSizeKB, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogMaxSpaceGB ) Write-Verbose -Message "Setting usage application $Name" @@ -166,61 +108,22 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabasePassword, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseUsername, - - [parameter(Mandatory = $false)] - [System.String] - $FailoverDatabaseServer, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogCutTime, - - [parameter(Mandatory = $false)] - [System.String] - $UsageLogLocation, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogMaxFileSizeKB, - - [parameter(Mandatory = $false)] - [System.UInt32] - $UsageLogMaxSpaceGB + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabasePassword, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $DatabaseUsername, + [parameter(Mandatory = $false)] [System.String] $FailoverDatabaseServer, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogCutTime, + [parameter(Mandatory = $false)] [System.String] $UsageLogLocation, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogMaxFileSizeKB, + [parameter(Mandatory = $false)] [System.UInt32] $UsageLogMaxSpaceGB ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for usage application '$Name'" - if ($result.Count -eq 0) { return $false } - else { - if ($PSBoundParameters.ContainsKey("UsageLogCutTime") -and $result.UsageLogCutTime -ne $UsageLogCutTime) { return $false } - if ($PSBoundParameters.ContainsKey("UsageLogLocation") -and $result.UsageLogDir -ne $UsageLogLocation) { return $false } - if ($PSBoundParameters.ContainsKey("UsageLogMaxFileSizeKB") -and $result.UsageLogMaxFileSize -ne $UsageLogMaxFileSizeKB) { return $false } - if ($PSBoundParameters.ContainsKey("UsageLogMaxSpaceGB") -and $result.UsageLogMaxSpaceGB -ne $UsageLogMaxSpaceGB) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("UsageLogCutTime", "UsageLogLocation", "UsageLogMaxFileSizeKB", "UsageLogMaxSpaceGB") } diff --git a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 index e726d1614..b9affd5e6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPUsageApplication" { Name = "Usage Service App" UsageLogCutTime = 60 UsageLogLocation = "L:\UsageLogs" - UsageLogMaxFileSize = 1024 + UsageLogMaxFileSizeKB = 1024 UsageLogMaxSpaceGB = 10 } @@ -43,8 +43,8 @@ Describe "xSPUsageApplication" { return @{ Name = $testParams.Name UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogDir = $testParams.UsageLogLocation - UsageLogMaxFileSize = $testParams.UsageLogMaxFileSize + UsageLogLocation = $testParams.UsageLogLocation + UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB } } @@ -55,8 +55,8 @@ Describe "xSPUsageApplication" { return @{ Name = $testParams.Name UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogDir = "C:\WrongPath" - UsageLogMaxFileSize = $testParams.UsageLogMaxFileSize + UsageLogLocation = "C:\WrongPath" + UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB } } @@ -65,8 +65,8 @@ Describe "xSPUsageApplication" { return @{ Name = $testParams.Name UsageLogCutTime = 0 - UsageLogDir = $testParams.UsageLogLocation - UsageLogMaxFileSize = $testParams.UsageLogMaxFileSize + UsageLogLocation = $testParams.UsageLogLocation + UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB } } @@ -75,8 +75,8 @@ Describe "xSPUsageApplication" { return @{ Name = $testParams.Name UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogDir = $testParams.UsageLogLocation - UsageLogMaxFileSize = 0 + UsageLogLocation = $testParams.UsageLogLocation + UsageLogMaxFileSizeKB = 0 UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB } } @@ -85,8 +85,8 @@ Describe "xSPUsageApplication" { return @{ Name = $testParams.Name UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogDir = $testParams.UsageLogLocation - UsageLogMaxFileSize = $testParams.UsageLogMaxFileSize + UsageLogLocation = $testParams.UsageLogLocation + UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB UsageLogMaxSpaceGB = 0 } } From 98d40eab9133af2d34deeffd11a49a3d61b81957 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 09:03:42 +1000 Subject: [PATCH 23/69] Fixed get method of xSPUserProfileService and bug fix in xSPCreateFarm --- .../MSFT_xSPCreateFarm.psm1 | 10 +- .../MSFT_xSPUserProfileServiceApp.psm1 | 199 ++++++------------ 2 files changed, 72 insertions(+), 137 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 2e74e4235..fbe46269b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -16,6 +16,8 @@ function Get-TargetResource Write-Verbose -Message "Checking for local SP Farm" $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + try { $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" } catch { @@ -27,10 +29,16 @@ function Get-TargetResource $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } $centralAdminSite = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" | Where-Object { $_.IsAdministrationWebApplication })[0] + if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { + $farmAccount = $params.FarmAccount + } else { + $farmAccount = $spFarm.DefaultServiceAccount.Name + } + $returnValue = @{ FarmConfigDatabaseName = $spFarm.Name DatabaseServer = $configDb.Server.Name - FarmAccount = $spFarm.DefaultServiceAccount.Name + FarmAccount = $farmAccount InstallAccount = $params.InstallAccount Passphrase = $params.Passphrase AdminContentDatabaseName = $centralAdminSite.ContentDatabases[0].Server diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 index a4cfd47f8..516eae2ac 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 @@ -4,49 +4,17 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.String] - $MySiteHostLocation, - - [parameter(Mandatory = $false)] - [System.String] - $ProfileDBName, - - [parameter(Mandatory = $false)] - [System.String] - $ProfileDBServer, - - [parameter(Mandatory = $false)] - [System.String] - $SocialDBName, - - [parameter(Mandatory = $false)] - [System.String] - $SocialDBServer, - - [parameter(Mandatory = $false)] - [System.String] - $SyncDBName, - - [parameter(Mandatory = $false)] - [System.String] - $SyncDBServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.String] $MySiteHostLocation, + [parameter(Mandatory = $false)] [System.String] $ProfileDBName, + [parameter(Mandatory = $false)] [System.String] $ProfileDBServer, + [parameter(Mandatory = $false)] [System.String] $SocialDBName, + [parameter(Mandatory = $false)] [System.String] $SocialDBServer, + [parameter(Mandatory = $false)] [System.String] $SyncDBName, + [parameter(Mandatory = $false)] [System.String] $SyncDBServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting user profile service application $Name" @@ -62,9 +30,37 @@ function Get-TargetResource } else { + $propData = $serviceApp.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic) + + $socialProp = $propData | Where-Object {$_.Name -eq "SocialDatabase"} + $socialDB = $socialProp.GetValue($serviceApp) + + $profileProp = $propData | Where-Object {$_.Name -eq "ProfileDatabase"} + $profileDB = $profileProp.GetValue($serviceApp) + + $syncProp = $propData | Where-Object {$_.Name -eq "SynchronizationDatabase"} + $syncDB = $syncProp.GetValue($serviceApp) + + $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" + + if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { + $farmAccount = $params.FarmAccount + } else { + $farmAccount = $spFarm.DefaultServiceAccount.Name + } + return @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name + FarmAccount = $farmAccount + MySiteHostLocation = $params.MySiteHostLocation + ProfileDBName = $profileProp.Name + ProfileDBServer = $profileProp.Server.Name + SocialDBName = $socialDB.Name + SocialDBServer = $socialDB.Server.Name + SyncDBName = $syncDB.Name + SyncDBServer = $syncDB.Server.Name + InstallAccount = $params.InstallAccount } } } @@ -77,49 +73,17 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.String] - $MySiteHostLocation, - - [parameter(Mandatory = $false)] - [System.String] - $ProfileDBName, - - [parameter(Mandatory = $false)] - [System.String] - $ProfileDBServer, - - [parameter(Mandatory = $false)] - [System.String] - $SocialDBName, - - [parameter(Mandatory = $false)] - [System.String] - $SocialDBServer, - - [parameter(Mandatory = $false)] - [System.String] - $SyncDBName, - - [parameter(Mandatory = $false)] - [System.String] - $SyncDBServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.String] $MySiteHostLocation, + [parameter(Mandatory = $false)] [System.String] $ProfileDBName, + [parameter(Mandatory = $false)] [System.String] $ProfileDBServer, + [parameter(Mandatory = $false)] [System.String] $SocialDBName, + [parameter(Mandatory = $false)] [System.String] $SocialDBServer, + [parameter(Mandatory = $false)] [System.String] $SyncDBName, + [parameter(Mandatory = $false)] [System.String] $SyncDBServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating user profile service application $Name" @@ -167,59 +131,22 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.String] - $MySiteHostLocation, - - [parameter(Mandatory = $false)] - [System.String] - $ProfileDBName, - - [parameter(Mandatory = $false)] - [System.String] - $ProfileDBServer, - - [parameter(Mandatory = $false)] - [System.String] - $SocialDBName, - - [parameter(Mandatory = $false)] - [System.String] - $SocialDBServer, - - [parameter(Mandatory = $false)] - [System.String] - $SyncDBName, - - [parameter(Mandatory = $false)] - [System.String] - $SyncDBServer, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.String] $MySiteHostLocation, + [parameter(Mandatory = $false)] [System.String] $ProfileDBName, + [parameter(Mandatory = $false)] [System.String] $ProfileDBServer, + [parameter(Mandatory = $false)] [System.String] $SocialDBName, + [parameter(Mandatory = $false)] [System.String] $SocialDBServer, + [parameter(Mandatory = $false)] [System.String] $SyncDBName, + [parameter(Mandatory = $false)] [System.String] $SyncDBServer, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for user profile service application $Name" - - if ($result.Count -eq 0) { return $false } - else { - if ($ApplicationPool -ne $result.ApplicationPool) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } Export-ModuleMember -Function *-TargetResource From 8e6382f2ce58bade5f5e0a08b03cd6b311d27714 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 09:39:07 +1000 Subject: [PATCH 24/69] Fixed get method in xSPUserProfileSyncService --- .../MSFT_xSPUserProfileSyncService.psm1 | 88 +++++++------------ ...ePoint.xSPUserProfileSyncService.Tests.ps1 | 8 +- 2 files changed, 36 insertions(+), 60 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index e4ab6ef91..226aafcf7 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -4,22 +4,10 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $UserProfileServiceAppName, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $UserProfileServiceAppName, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting the local user profile sync service instance" @@ -27,10 +15,27 @@ function Get-TargetResource $params = $args[0] $syncService = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq (Get-xSharePointServiceApplicationName -Name UserProfileSync) } - + + if ($syncService.UserProfileApplicationGuid -ne [Guid]::Empty) { + $upa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Identity = $syncService.UserProfileApplicationGuid } -ErrorAction SilentlyContinue + } if ($null -eq $syncService) { return @{} } + if ($syncService.Status -eq "Online") { $localEnsure = "Present" } else { $localEnsure = "Absent" } + + $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" + + if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { + $farmAccount = $params.FarmAccount + } else { + $farmAccount = $spFarm.DefaultServiceAccount.Name + } + return @{ + UserProfileServiceAppName = $upa.Name + Ensure = $localEnsure + FarmAccount = $farmAccount + InstallAccount = $params.InstallAccount Status = $syncService.Status } } @@ -43,22 +48,10 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $UserProfileServiceAppName, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $UserProfileServiceAppName, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Setting User Profile Synchronization Service" @@ -120,32 +113,15 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $UserProfileServiceAppName, - - [parameter(Mandatory = $true)] - [ValidateSet("Present","Absent")] - [System.String] - $Ensure, - - [parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $FarmAccount, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $UserProfileServiceAppName, + [parameter(Mandatory = $true)] [ValidateSet("Present","Absent")] [System.String] $Ensure, + [parameter(Mandatory = $true)] [System.Management.Automation.PSCredential] $FarmAccount, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for User Profile Synchronization Service" - if ($result.Count -eq 0) { return $false } - else { - if (($result.Status -eq "Online") -and ($Ensure -ne "Present")) { return $false } - if (($result.Status -eq "Disabled") -and ($Ensure -ne "Absent")) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure") } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index 9ae580108..340653a36 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -38,7 +38,7 @@ Describe "xSPUserProfileSyncService" { It "Passes when the user profile sync service is running and should be" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - Status = "Online" + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $true @@ -46,7 +46,7 @@ Describe "xSPUserProfileSyncService" { It "Fails when the user profile sync service is not running and should be" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - Status = "Disabled" + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $false @@ -57,7 +57,7 @@ Describe "xSPUserProfileSyncService" { It "Fails when the user profile sync service is running and should not be" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - Status = "Online" + Ensure = "Present" } } Test-TargetResource @testParams | Should Be $false @@ -65,7 +65,7 @@ Describe "xSPUserProfileSyncService" { It "Passes when the user profile sync service is not running and should not be" { Mock -ModuleName $ModuleName Get-TargetResource { return @{ - Status = "Disabled" + Ensure = "Absent" } } Test-TargetResource @testParams | Should Be $true From c4fe53f2d92fba66a05cfef141a7ef7f8c6c1868 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 09:47:34 +1000 Subject: [PATCH 25/69] Fixed claims auth detection in xSPSite --- .../DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 index 38172102e..14d294051 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 @@ -30,22 +30,18 @@ function Get-TargetResource else { if ($site.HostHeaderIsSiteName) { $HostHeaderWebApplication = $site.Url } - if ($site.Owner.UserLogin.Contains("#")) { - # Claims based authentication user + if ($site.WebApplication.UseClaimsAuthentication) { $owner = Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.Owner.UserLogin; IdentityType = "EncodedClaim" } } else { - # Classic authentication user $owner = $site.Owner.UserLogin } if ($null -eq $site.SecondaryContact) { $secondaryOwner = $null } else { - if ($site.SecondaryContact.UserLogin.Contains("#")) { - # Claims based authentication user + if ($site.WebApplication.UseClaimsAuthentication) { $secondaryOwner = Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.SecondaryContact.UserLogin; IdentityType = "EncodedClaim" } } else { - # Classic authentication user $secondaryOwner = $site.SecondaryContact.UserLogin } } From 37edae73540835c086ed29627d3ee7a1db298287 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 11:07:17 +1000 Subject: [PATCH 26/69] Fixed get methof of xSPWebApplication --- .../MSFT_xSPWebApplication.psm1 | 204 +++++------------- .../xSharePoint/xSharePoint.Global.Tests.ps1 | 2 +- .../xSharePoint.xSPWebApplication.Tests.ps1 | 2 +- 3 files changed, 54 insertions(+), 154 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index a1c608417..106c6a652 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -4,54 +4,18 @@ function Get-TargetResource [OutputType([System.Collections.Hashtable])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPoolAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $false)] - [System.Boolean] - $AllowAnonymous, - - [parameter(Mandatory = $false)] - [ValidateSet("NTLM","Kerberos")] - [System.String] - $AuthenticationMethod, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $HostHeader, - - [parameter(Mandatory = $false)] - [System.String] - $Path, - - [parameter(Mandatory = $false)] - [System.String] - $Port, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.String] $ApplicationPoolAccount, + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.Boolean] $AllowAnonymous, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $HostHeader, + [parameter(Mandatory = $false)] [System.String] $Path, + [parameter(Mandatory = $false)] [System.String] $Port, + [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Getting web application '$Name'" @@ -61,11 +25,24 @@ function Get-TargetResource $wa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue if ($null -eq $wa) { return @{} } - + + $authProvider = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ WebApplication = $wa.Url; Zone = "Default" } + + if ($authProvider.DisableKerberos -eq $true) { $localAuthMode = "NTLM" } else { $localAuthMode = "Kerberos" } + return @{ Name = $wa.DisplayName ApplicationPool = $wa.ApplicationPool.Name ApplicationPoolAccount = $wa.ApplicationPool.Username + Url = $wa.Url + AllowAnonymous = $authProvider.AllowAnonymous + DatabaseName = $wa.ContentDatabases[0].Name + DatabaseServer = $wa.ContentDatabases[0].Server + HostHeader = [Uri]::New($wa.Url).Host + Path = $wa.IisSettings[0].Path + Port = [Uri]::New($wa.Url).Port + AuthenticationMethod = $localAuthMode + InstallAccount = $params.InstallAccount } } return $result @@ -77,54 +54,18 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPoolAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $false)] - [System.Boolean] - $AllowAnonymous, - - [parameter(Mandatory = $false)] - [ValidateSet("NTLM","Kerberos")] - [System.String] - $AuthenticationMethod, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $HostHeader, - - [parameter(Mandatory = $false)] - [System.String] - $Path, - - [parameter(Mandatory = $false)] - [System.String] - $Port, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.String] $ApplicationPoolAccount, + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.Boolean] $AllowAnonymous, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $HostHeader, + [parameter(Mandatory = $false)] [System.String] $Path, + [parameter(Mandatory = $false)] [System.String] $Port, + [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) Write-Verbose -Message "Creating web application '$Name'" @@ -165,64 +106,23 @@ function Test-TargetResource [OutputType([System.Boolean])] param ( - [parameter(Mandatory = $true)] - [System.String] - $Name, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPool, - - [parameter(Mandatory = $true)] - [System.String] - $ApplicationPoolAccount, - - [parameter(Mandatory = $true)] - [System.String] - $Url, - - [parameter(Mandatory = $false)] - [System.Boolean] - $AllowAnonymous, - - [parameter(Mandatory = $false)] - [ValidateSet("NTLM","Kerberos")] - [System.String] - $AuthenticationMethod, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseName, - - [parameter(Mandatory = $false)] - [System.String] - $DatabaseServer, - - [parameter(Mandatory = $false)] - [System.String] - $HostHeader, - - [parameter(Mandatory = $false)] - [System.String] - $Path, - - [parameter(Mandatory = $false)] - [System.String] - $Port, - - [parameter(Mandatory = $false)] - [System.Management.Automation.PSCredential] - $InstallAccount + [parameter(Mandatory = $true)] [System.String] $Name, + [parameter(Mandatory = $true)] [System.String] $ApplicationPool, + [parameter(Mandatory = $true)] [System.String] $ApplicationPoolAccount, + [parameter(Mandatory = $true)] [System.String] $Url, + [parameter(Mandatory = $false)] [System.Boolean] $AllowAnonymous, + [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $false)] [System.String] $DatabaseServer, + [parameter(Mandatory = $false)] [System.String] $HostHeader, + [parameter(Mandatory = $false)] [System.String] $Path, + [parameter(Mandatory = $false)] [System.String] $Port, + [parameter(Mandatory = $false)] [ValidateSet("NTLM","Kerberos")] [System.String] $AuthenticationMethod, + [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource -Name $Name -ApplicationPool $ApplicationPool -ApplicationPoolAccount $ApplicationPoolAccount -Url $Url -InstallAccount $InstallAccount + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for web application '$Name'" - if ($result.Count -eq 0) { return $false } - else { - if ($result.ApplicationPool -ne $ApplicationPool) { return $false } - if ($result.ApplicationPoolAccount -ne $ApplicationPoolAccount) { return $false } - } - return $true + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 b/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 index e50251f85..a6b145bc7 100644 --- a/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 @@ -130,7 +130,7 @@ Describe 'PowerShell Modules' { $tokens = $null $errors = $null $ast = [System.Management.Automation.Language.Parser]::ParseFile($fileName, [ref] $tokens, [ref] $errors) - return $tokens | Where-Object { $_.TokenFlags -contains "CommandName" -and $_.Value -like "*-SP*"} | ft + return $tokens | Where-Object { $_.TokenFlags -contains "CommandName" -and $_.Text -like "*-SP*"} | ft } It "doesn't call SharePoint PowerShell cmdlets directly" { diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 index a1db18553..df4bc81f0 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 @@ -25,7 +25,7 @@ Describe "xSPWebApplication" { Context "Validate get method" { It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } + Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } Get-TargetResource @testParams Assert-VerifiableMocks } From f84f07481a9f936ca8ef94876eb9e0ee0d0ea7ea Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 12:56:18 +1000 Subject: [PATCH 27/69] Fix issue with state detection in xSPServiceInstance --- .../MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 index 0ac188d47..b11621860 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 @@ -16,7 +16,7 @@ function Get-TargetResource $si = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq $params.Name } if ($null -eq $si) { return @{} } - if ($si.Status) { $localEnsure = "Present" } else { $localEnsure = "Absent" } + if ($si.Status -eq "Online") { $localEnsure = "Present" } else { $localEnsure = "Absent" } return @{ Name = $params.Name From 05b512fe04946710c8779ca67120b3b80290503e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 20:05:02 +1000 Subject: [PATCH 28/69] Added test for MOF schema checking --- Tests/Tests.pssproj | 1 + .../xSharePoint/xSharePoint.Global.Tests.ps1 | 16 +- .../xSharePoint/xSharePoint.TestHelpers.psm1 | 179 ++++++++++++++++++ 3 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 Tests/xSharePoint/xSharePoint.TestHelpers.psm1 diff --git a/Tests/Tests.pssproj b/Tests/Tests.pssproj index b21b06b52..597acb246 100644 --- a/Tests/Tests.pssproj +++ b/Tests/Tests.pssproj @@ -54,6 +54,7 @@ + diff --git a/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 b/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 index a6b145bc7..d150ecd1c 100644 --- a/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 @@ -10,6 +10,7 @@ $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +Import-Module "$PSScriptRoot\xSharePoint.TestHelpers.psm1" Describe 'xSharePoint Global Tests' { @@ -17,9 +18,9 @@ Describe 'xSharePoint Global Tests' { ($_.FullName -like "*\DscResources\*") }) - Context 'MOF schemas use InstallAccount' { + Context 'MOF schemas' { - It "Doesn't have InstallAccount as a required parameter" { + It "Don't have InstallAccount as a required parameter" { $mofFilesWithNoInstallAccount = 0 $mofFiles | % { $fileHasInstallAccount = $false @@ -35,6 +36,17 @@ Describe 'xSharePoint Global Tests' { } $mofFilesWithNoInstallAccount | Should Be 0 } + + + + It "Has MOF schemas that match properties on PowerShell functions" { + $filesWithErrors = 0 + $WarningPreference = "Continue" + $mofFiles | % { + if ((Assert-MofSchemaScriptParameters $_.FullName) -eq $false) { $filesWithErrors++ } + } + $filesWithErrors | Should Be 0 + } } } diff --git a/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 b/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 new file mode 100644 index 000000000..b8cafe9db --- /dev/null +++ b/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 @@ -0,0 +1,179 @@ +function Get-MofSchemaObject() { + param( + [Parameter(Mandatory=$True)] + [string]$fileName + ) + $contents = Get-Content $fileName + + $results = @{ + ClassVersion = $null + FriendlyName = $null + ClassName = $null + Attributes = @() + } + + foreach($textLine in $contents) { + if ($textLine.Contains("ClassVersion") -or $textLine.Contains("ClassVersion")) { + if ($textLine -match "ClassVersion(`"*.`")") { + $start = $textLine.IndexOf("ClassVersion(`"") + 14 + $end = $textLine.IndexOf("`")", $start) + $results.ClassVersion = $textLine.Substring($start, $end - $start) + } + + if ($textLine -match "FriendlyName(`"*.`")") { + $start = $textLine.IndexOf("FriendlyName(`"") + 14 + $end = $textLine.IndexOf("`")", $start) + $results.FriendlyName = $textLine.Substring($start, $end - $start) + } + } elseif ($textLine.Contains("class ")) { + $start = $textLine.IndexOf("class ") + 6 + $end = $textLine.IndexOf(" ", $start) + $results.ClassName = $textLine.Substring($start, $end - $start) + } elseif ($textLine.Trim() -eq "{" -or $textLine.Trim() -eq "};" -or [string]::IsNullOrEmpty($textLine)) { + } else { + $attributeValue = @{ + State = $null + EmbeddedInstance = $null + ValueMap = $null + DataType = $null + Name = $null + } + + $start = $textLine.IndexOf("[") + 1 + $end = $textLine.IndexOf("]", $start) + $metadataEnd = $end + $metadata = $textLine.Substring($start, $end - $start) + $metadataObjects = $metadata.Split(",") + $attributeValue.State = $metadataObjects[0] + + $metadataObjects | ForEach-Object { + if ($_.Trim().StartsWith("EmbeddedInstance")) { + $start = $textLine.IndexOf("EmbeddedInstance(`"") + 18 + $end = $textLine.IndexOf("`")", $start) + $attributeValue.EmbeddedInstance = $textLine.Substring($start, $end - $start) + } + if ($_.Trim().StartsWith("ValueMap")) { + $start = $textLine.IndexOf("ValueMap{") + 9 + $end = $textLine.IndexOf("}", $start) + $valueMap = $textLine.Substring($start, $end - $start) + $attributeValue.ValueMap = $valueMap.Replace("`"", "").Split(",") + } + } + + $nonMetadata = $textLine.Replace(";","").Substring($metadataEnd + 1) + + $nonMetadataObjects = $nonMetadata.Split(" ") + $attributeValue.DataType = $nonMetadataObjects[1] + $attributeValue.Name = $nonMetadataObjects[2] + + $results.Attributes += $attributeValue + } + } + return $results +} + +function Assert-MofSchemaScriptParameters() { + param( + [Parameter(Mandatory=$True)] + [string]$mofFileName + ) + $hasErrors = $false + $mofData = Get-MofSchemaObject -fileName $mofFileName + $psFile = $mofFileName.Replace(".schema.mof", ".psm1") + + $tokens = $null + $errors = $null + $ast = [System.Management.Automation.Language.Parser]::ParseFile($psFile, [ref] $tokens, [ref] $errors) + $functions = $ast.FindAll( {$args[0] -is [System.Management.Automation.Language.FunctionDefinitionAst]}, $true) + + $functions | ForEach-Object { + $function = $_ + $astTokens = $null + $astErrors = $null + $functionAst = [System.Management.Automation.Language.Parser]::ParseInput($_.Body, [ref] $astTokens, [ref] $astErrors) + + $parameters = $functionAst.FindAll( {$args[0] -is [System.Management.Automation.Language.ParameterAst]}, $true) + + foreach ($mofParameter in $mofData.Attributes) { + # Check the parameter exists + $paramToCheck = $parameters | Where-Object { $_.Name.ToString() -eq "`$$($mofParameter.Name)" } + + if ($null -eq $paramToCheck) { + $hasErrors = $true + Write-Warning "File $psFile is missing parameter $($mofParameter.Name) from the $($_.Name) method" + } + + $parameterAttribute = $paramToCheck.Attributes | ? { $_.TypeName.ToString() -eq "parameter" } -ErrorAction SilentlyContinue + + if (($mofParameter.State -eq "Key" -or $mofParameter.State -eq "Required")) { + + if (-not $parameterAttribute) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is not marked as mandatory (has no parameter attribute) in the $($function.Name) method" + } else { + $isMandatoryInScript = [bool]::Parse(($parameterAttribute.NamedArguments | ? { $_.ArgumentName -eq "Mandatory" }).Argument.VariablePath.ToString()) + + if ($isMandatoryInScript -eq $false) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is not marked as mandatory in the $($function.Name) method" + } + } + } + + if ($mofParameter.State -eq "Write") { + if ($null -ne $parameterAttribute) { + $isMandatoryInScript = [bool]::Parse(($parameterAttribute.NamedArguments | ? { $_.ArgumentName -eq "Mandatory" }).Argument.VariablePath.ToString()) + if ($isMandatoryInScript -eq $true) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is marked as mandatory in the $($function.Name) method and it should not be" + } + } + } + + if ($null -ne $mofParameter.ValueMap) { + $validateSetAttribute = ($paramToCheck.Attributes | ? { $_.TypeName.ToString() -eq "ValidateSet" }) + + if (-not $validateSetAttribute) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is missing a ValidateSet attribute in the $($function.Name) method" + } + + $psValidateSetParams = $validateSetAttribute.PositionalArguments | % { $_.Value.ToString() } + + $mofParameter.ValueMap | ForEach-Object { + if ($psValidateSetParams -notcontains $_) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that does not have '$_' in its validateset parameter for $($function.Name) method" + } + } + + $psValidateSetParams | ForEach-Object { + if ($mofParameter.ValueMap -notcontains $_) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that contains '$_' in the $($function.Name) function which is not in the valuemap in the schema" + } + } + } + + if ($mofParameter.EmbeddedInstance -eq $null) { + if (($paramToCheck.Attributes | ? { $_.TypeName.ToString() -match $mofParameter.DataType }) -eq $null) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) in function $($function.Name) that does not match the data type of the schema" + } + } else { + switch ($mofParameter.EmbeddedInstance) { + "MSFT_Credential" { + if (($paramToCheck.Attributes | ? { $_.TypeName.ToString() -match "PSCredential" }) -eq $null) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) in function $($function.Name) that does not match the data type of the schema" + } + } + } + } + } + } + + return (!$hasErrors) +} + +Export-ModuleMember * \ No newline at end of file From 8f4959b9c76be226241f59a7ac0c30ef05555bf6 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Tue, 15 Sep 2015 21:10:44 +1000 Subject: [PATCH 29/69] Fixed but stoping provisioning of UPS sync --- .../MSFT_xSPUserProfileSyncService.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index 226aafcf7..24bbf1415 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -73,7 +73,7 @@ function Set-TargetResource $syncService = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq (Get-xSharePointServiceApplicationName -Name UserProfileSync) } # Start the Sync service if it should be running on this server - if (($Ensure -eq "Present") -and ($syncService.Status -ne "Online")) { + if (($params.Ensure -eq "Present") -and ($syncService.Status -ne "Online")) { Set-xSharePointUserProfileSyncMachine -UserProfileServiceAppName $params.UserProfileServiceAppName -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount Invoke-xSharePointSPCmdlet -CmdletName "Start-SPServiceInstance" -Arguments @{ Identity = $syncService.ID } From 9524cfe6fab49c277e89d9ec46411da565ca6b50 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 09:07:45 +1000 Subject: [PATCH 30/69] Added code coverage to AppVeyor output --- appveyor.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0ae1dbfea..d9a05c8f2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,9 @@ build: off test_script: - ps: | $testResultsFile = ".\TestsResults.xml" - $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru + $testCoverageFiles = @() + Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint\**\*.psm1" -Recurse | ForEach-Object { $testCoverageFiles += $_.FullName } + $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru -CodeCoverage $testCoverageFiles (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed." @@ -20,9 +22,6 @@ test_script: after_test: - ps: | - - - Remove-Item (Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.pssproj") $manifest = Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.psd1" (Get-Content $manifest -Raw).Replace("0.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest @@ -34,5 +33,3 @@ after_test: nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory $env:APPVEYOR_BUILD_FOLDER $nuGetPackageName = $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg" Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\$nuGetPackageName" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } - - From 6b2e3c3a43b7b5ef333c8709b993d5da25322bf1 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 09:59:16 +1000 Subject: [PATCH 31/69] Fixed issue with arguments in xSPCreateFarm --- .../DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index fbe46269b..8b5cb0c82 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -26,8 +26,8 @@ function Get-TargetResource if ($null -eq $spFarm) {return @{ }} - $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } - $centralAdminSite = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" | Where-Object { $_.IsAdministrationWebApplication })[0] + $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } + $centralAdminSite = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.IsAdministrationWebApplication })[0] if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { $farmAccount = $params.FarmAccount From e29a898c60f948ba7274c39937cec930fa0f7f6a Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 10:07:19 +1000 Subject: [PATCH 32/69] Fix incorrect cmdlet name in xSPWebApplication --- .../MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index 106c6a652..26d68d859 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -26,7 +26,7 @@ function Get-TargetResource $wa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue if ($null -eq $wa) { return @{} } - $authProvider = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ WebApplication = $wa.Url; Zone = "Default" } + $authProvider = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPAuthenticationProvider" -Arguments @{ WebApplication = $wa.Url; Zone = "Default" } if ($authProvider.DisableKerberos -eq $true) { $localAuthMode = "NTLM" } else { $localAuthMode = "Kerberos" } From 5044f5af3816e02e3b249e5d6baa7e45d8f2fd79 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 10:58:54 +1000 Subject: [PATCH 33/69] Fixed issue where owner could be null in get for xSPSite --- .../MSFT_xSPSite/MSFT_xSPSite.psm1 | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 index 14d294051..071f3ba30 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 @@ -26,21 +26,26 @@ function Get-TargetResource $params = $args[0] $site = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPSite" -Arguments @{ Identity = $params.Url } -ErrorAction SilentlyContinue - if ($null -eq $site) { return @{} } - else { - if ($site.HostHeaderIsSiteName) { $HostHeaderWebApplication = $site.Url } + if ($null -eq $site) { + return @{} + } else { + if ($site.HostHeaderIsSiteName) { $HostHeaderWebApplication = $site.WebApplication.Url } - if ($site.WebApplication.UseClaimsAuthentication) { - $owner = Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.Owner.UserLogin; IdentityType = "EncodedClaim" } + if ($null -eq $site.Owner) { + $owner = $null } else { - $owner = $site.Owner.UserLogin + if ($site.WebApplication.UseClaimsAuthentication) { + $owner = (Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.Owner.UserLogin; IdentityType = "EncodedClaim" }).Value + } else { + $owner = $site.Owner.UserLogin + } } - + if ($null -eq $site.SecondaryContact) { $secondaryOwner = $null } else { if ($site.WebApplication.UseClaimsAuthentication) { - $secondaryOwner = Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.SecondaryContact.UserLogin; IdentityType = "EncodedClaim" } + $secondaryOwner = (Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.SecondaryContact.UserLogin; IdentityType = "EncodedClaim" }).Value } else { $secondaryOwner = $site.SecondaryContact.UserLogin } From 644413616b3230a474e7bbe4a7161860271c4c7e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 11:32:42 +1000 Subject: [PATCH 34/69] Fix for detection of value types in Test-xSharePointSpecificParameters util method --- .../xSharePoint.Util/xSharePoint.Util.psm1 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index b721234eb..617f228c2 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -173,7 +173,24 @@ function Test-xSharePointSpecificParameters() { $KeyList | ForEach-Object { if ((-not $CurrentValues.ContainsKey($_)) -or ($CurrentValues.$_ -ne $DesiredValues.$_)) { - $returnValue = $false + if ($DesiredValues.ContainsKey($_)) { + $desiredType = $DesiredValues.$_.GetType() + switch ($desiredType.Name) { + "String" { + if ([string]::IsNullOrEmpty($CurrentValues.$_) -ne [string]::IsNullOrEmpty($DesiredValues.$_)) { + $returnValue = $false + } + } + "Int32" { + if (($DesiredValues.$_ -eq 0) -and ($CurrentValues.$_ -eq $null)) {} else { + $returnValue = $false + } + } + default { + $returnValue = $false + } + } + } } } return $returnValue From 127898c0b91923a89d878252f28ad41565beb3c2 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 12:45:39 +1000 Subject: [PATCH 35/69] Fixed issue with local variable use in Test-xSharePointSpecificParameters --- .../Modules/xSharePoint.Util/xSharePoint.Util.psm1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 617f228c2..d66aa74f4 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -175,14 +175,15 @@ function Test-xSharePointSpecificParameters() { if ((-not $CurrentValues.ContainsKey($_)) -or ($CurrentValues.$_ -ne $DesiredValues.$_)) { if ($DesiredValues.ContainsKey($_)) { $desiredType = $DesiredValues.$_.GetType() + $fieldName = $_ switch ($desiredType.Name) { "String" { - if ([string]::IsNullOrEmpty($CurrentValues.$_) -ne [string]::IsNullOrEmpty($DesiredValues.$_)) { + if ([string]::IsNullOrEmpty($CurrentValues.$fieldName) -and [string]::IsNullOrEmpty($DesiredValues.$fieldName)) {} else { $returnValue = $false } } "Int32" { - if (($DesiredValues.$_ -eq 0) -and ($CurrentValues.$_ -eq $null)) {} else { + if (($DesiredValues.$fieldName -eq 0) -and ($CurrentValues.$fieldName -eq $null)) {} else { $returnValue = $false } } From 8dd2ad0ecfd007e943651b756f6a1bd2a8a24ec6 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 13:02:54 +1000 Subject: [PATCH 36/69] Fixed bug with database details and log size in get method --- .../MSFT_xSPUsageApplication.psm1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 index 9b69fe7ca..9bffe3612 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 @@ -34,11 +34,11 @@ function Get-TargetResource return @{ Name = $serviceApp.DisplayName InstallAccount = $params.InstallAccount - DatabaseName = $serviceApp.Applications.UsageDatabase.Name - DatabaseServer = $serviceApp.Applications.UsageDatabase.Server.Name - DatabasePassword = $serviceApp.Applications.UsageDatabase.Password - DatabaseUsername = $serviceApp.Applications.UsageDatabase.Username - FailoverDatabaseServer = $serviceApp.Applications.UsageDatabase.FailoverServer + DatabaseName = $serviceApp.UsageDatabase.Name + DatabaseServer = $serviceApp.UsageDatabase.Server.Name + DatabasePassword = $serviceApp.UsageDatabase.Password + DatabaseUsername = $serviceApp.UsageDatabase.Username + FailoverDatabaseServer = $serviceApp.UsageDatabase.FailoverServer UsageLogCutTime = $service.UsageLogCutTime UsageLogLocation = $service.UsageLogDir UsageLogMaxFileSizeKB = $service.UsageLogMaxFileSize From 90b7f19fe68183c5878d3e4bb2914352c150097b Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 13:20:02 +1000 Subject: [PATCH 37/69] Fixed wrong variable names in get for xSPStateServiceApp --- .../MSFT_xSPStateServiceApp.psm1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 index c51a3abc8..d8a211046 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 @@ -16,14 +16,14 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $app = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPStateServiceApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue + $serviceApp = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPStateServiceApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue - if ($null -eq $app) { return @{} } + if ($null -eq $serviceApp) { return @{} } return @{ Name = $serviceApp.DisplayName - DatabaseName = $serviceApp.Database.Name - DatabaseServer = $serviceApp.Database.Server.Name + DatabaseName = $serviceApp.Databases.Name + DatabaseServer = $serviceApp.Databases.Server.Name InstallAccount = $params.InstallAccount } } @@ -77,7 +77,7 @@ function Test-TargetResource [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $CurrentValues = Get-TargetResource -Name $Name -InstallAccount $InstallAccount + $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for state service application $Name" return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name") } From 59808bd48a8f8dd8ec628bdccbba96917d360e1f Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 13:27:43 +1000 Subject: [PATCH 38/69] Fixed firewall detection for xSPDistribuedCacheService --- .../MSFT_xSPDistributedCacheService.psm1 | 2 +- .../xSharePoint.DistributedCache.psm1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index 3ebee75ce..dd771d523 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource Name = $params.Name CacheSizeInMB = $cacheHostConfig.Size ServiceAccount = $windowsService.StartName - CreateFirewallRules = (-not $firewallRule) + CreateFirewallRules = ($firewallRule -ne $null) Ensure = "Present" InstallAccount = $params.InstallAccount } diff --git a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 index 1b8064326..7bb49b1da 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 @@ -78,7 +78,7 @@ function Enable-xSharePointDCFireWallRule() { $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -ErrorAction SilentlyContinue if($null -eq $firewallRule) { - New-NetFirewallRule -Name "SPDistCache" -DisplayName "SharePoint Distributed Cache" -Protocol TCP -LocalPort 22233-22236 + New-NetFirewallRule -Name "SPDistCache" -DisplayName "SharePoint Distributed Cache" -Protocol TCP -LocalPort 22233-22236 -Group "SharePoint" } Enable-NetFirewallRule -DisplayName "SharePoint Distributed Cache" } From 30743050393c24ffd739ebe6efb14f6c50b6e388 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 13:34:32 +1000 Subject: [PATCH 39/69] Fixed bug in set for xSPManagedPath --- .../MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 index c7312d2bb..a722a44d1 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 @@ -50,10 +50,11 @@ function Set-TargetResource Write-Verbose -Message "Creating the managed path $RelativeUrl in $WebAppUrl" - $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - $path = Get-TargetResource @params + $path = Get-TargetResource @params -ErrorAction SilentlyContinue if ($null -eq $path) { $newParams = @{} From 4542b923d77cc38f70932893893df2ee7622b2d8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Wed, 16 Sep 2015 22:56:53 +1000 Subject: [PATCH 40/69] Fixed issue with test in xSPManagedAccount --- .../MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 index 72491d946..7341dfb52 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 @@ -86,7 +86,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing managed account $AccountName" - return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Schedule","PreExpireDays","EmailNotification") + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("AccountName", "Schedule","PreExpireDays","EmailNotification") } From 8c3ea7d12b3badd83cb5e1f82bb92f57e4e9ebc3 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 17 Sep 2015 09:02:30 +1000 Subject: [PATCH 41/69] Fixed typo in get method for xSPManagedAccount --- .../MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 index 7341dfb52..6a841c0dc 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 @@ -21,7 +21,7 @@ function Get-TargetResource $ma = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPManagedAccount" -Arguments @{ Identity = $params.Account.UserName } -ErrorAction SilentlyContinue if ($null -eq $ma) { return @{ } } return @{ - AccountName = $ma.Userame + AccountName = $ma.Username EmailNotification = $ma.DaysBeforeChangeToEmail PreExpireDays = $ma.DaysBeforeExpiryToChange Schedule = $ma.ChangeSchedule From 813d68d3839ed4b4503b2e4c52712cc2f4efe05a Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 17 Sep 2015 09:15:18 +1000 Subject: [PATCH 42/69] Fixed bug with log file size detection in xSPUsageApplication --- .../MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 index 9bffe3612..6ceb37fc5 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 @@ -41,7 +41,7 @@ function Get-TargetResource FailoverDatabaseServer = $serviceApp.UsageDatabase.FailoverServer UsageLogCutTime = $service.UsageLogCutTime UsageLogLocation = $service.UsageLogDir - UsageLogMaxFileSizeKB = $service.UsageLogMaxFileSize + UsageLogMaxFileSizeKB = $service.UsageLogMaxFileSize / 1024 UsageLogMaxSpaceGB = $service.UsageLogMaxSpaceGB } } From 7a642ab66229d26a02fd1a8378a1afb131d609a5 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 17 Sep 2015 09:47:49 +1000 Subject: [PATCH 43/69] Fixed bug that prevented creation of managed paths --- .../MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 index a722a44d1..2c1073fbc 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 @@ -22,7 +22,7 @@ function Get-TargetResource $getParams.Add("HostHeader", $true) } $path = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPManagedPath" -Arguments $getParams -ErrorAction SilentlyContinue - if ($null -eq $path) { return @{} } + if ($null -eq $path) { return $null } return @{ RelativeUrl = $path.Name @@ -52,9 +52,11 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } $path = Get-TargetResource @params -ErrorAction SilentlyContinue + + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } + if ($null -eq $path) { $newParams = @{} @@ -88,6 +90,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Looking up the managed path $RelativeUrl in $WebAppUrl" + if ($CurrentValues -eq $null) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("WebAppUrl","RelativeUrl","Explicit","HostHeader") } From bdff26267ff80957e1736a484046ad7eeb69d39e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 17 Sep 2015 10:57:35 +1000 Subject: [PATCH 44/69] Fixed issue with verbose parameter being passed for comparison --- .../MSFT_xSPManagedPath.psm1 | 2 +- .../xSharePoint.Util/xSharePoint.Util.psm1 | 35 ++++++++++--------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 index 2c1073fbc..c685475ef 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 @@ -90,7 +90,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Looking up the managed path $RelativeUrl in $WebAppUrl" - if ($CurrentValues -eq $null) { return $false } + if ($CurrentValues -eq $null) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("WebAppUrl","RelativeUrl","Explicit","HostHeader") } diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index d66aa74f4..956b6b43d 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -172,27 +172,30 @@ function Test-xSharePointSpecificParameters() { } $KeyList | ForEach-Object { - if ((-not $CurrentValues.ContainsKey($_)) -or ($CurrentValues.$_ -ne $DesiredValues.$_)) { - if ($DesiredValues.ContainsKey($_)) { - $desiredType = $DesiredValues.$_.GetType() - $fieldName = $_ - switch ($desiredType.Name) { - "String" { - if ([string]::IsNullOrEmpty($CurrentValues.$fieldName) -and [string]::IsNullOrEmpty($DesiredValues.$fieldName)) {} else { - $returnValue = $false + if ($_ -ne "Verbose") { + if (($CurrentValues.ContainsKey($_) -eq $false) -or ($CurrentValues.$_ -ne $DesiredValues.$_)) { + if ($DesiredValues.ContainsKey($_)) { + $desiredType = $DesiredValues.$_.GetType() + $fieldName = $_ + switch ($desiredType.Name) { + "String" { + if ([string]::IsNullOrEmpty($CurrentValues.$fieldName) -and [string]::IsNullOrEmpty($DesiredValues.$fieldName)) {} else { + $returnValue = $false + } } - } - "Int32" { - if (($DesiredValues.$fieldName -eq 0) -and ($CurrentValues.$fieldName -eq $null)) {} else { + "Int32" { + if (($DesiredValues.$fieldName -eq 0) -and ($CurrentValues.$fieldName -eq $null)) {} else { + $returnValue = $false + } + } + default { $returnValue = $false } } - default { - $returnValue = $false - } - } - } + } + } } + } return $returnValue } From 5f0c0841da2defd8048d2d259d471a35ba22d3dd Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 00:23:26 +1000 Subject: [PATCH 45/69] Refactored full test suite to new stubs model --- .../MSFT_xSPBCSServiceApp.psm1 | 70 +- .../MSFT_xSPCacheAccounts.psm1 | 17 +- .../MSFT_xSPCreateFarm.psm1 | 27 +- .../MSFT_xSPDiagnosticLoggingSettings.psm1 | 17 +- .../MSFT_xSPDistributedCacheService.psm1 | 53 +- .../MSFT_xSPFeature/MSFT_xSPFeature.psm1 | 11 +- .../MSFT_xSPInstallPrereqs.psm1 | 13 +- .../MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 | 20 +- .../MSFT_xSPManagedAccount.psm1 | 13 +- .../MSFT_xSPManagedMetaDataServiceApp.psm1 | 39 +- .../MSFT_xSPManagedPath.psm1 | 9 +- .../MSFT_xSPSearchServiceApp.psm1 | 48 +- .../MSFT_xSPSecureStoreServiceApp.psm1 | 58 +- .../MSFT_xSPServiceAppPool.psm1 | 19 +- .../MSFT_xSPServiceInstance.psm1 | 27 +- .../MSFT_xSPSite/MSFT_xSPSite.psm1 | 17 +- .../MSFT_xSPStateServiceApp.psm1 | 21 +- .../MSFT_xSPStateServiceApp.schema.mof | 2 +- .../MSFT_xSPUsageApplication.psm1 | 29 +- .../MSFT_xSPUserProfileServiceApp.psm1 | 73 +- .../MSFT_xSPUserProfileSyncService.psm1 | 39 +- .../MSFT_xSPWebApplication.psm1 | 38 +- .../xSharePoint.DistributedCache.psm1 | 67 +- .../xSharePoint.ServiceApplications.psm1 | 39 - .../xSharePoint.UserProfileService.psm1 | 6 +- .../xSharePoint.Util/xSharePoint.Util.psm1 | 4 +- Modules/xSharePoint/xSharePoint.psd1 | 3 - Modules/xSharePoint/xSharePoint.pssproj | 2 - .../DistributedCache/DistributedCache.psm1 | 18 + .../Microsoft.SharePoint.PowerShell.psm1 | 20554 ++++++++++++++ .../Microsoft.SharePoint.PowerShell.psm1 | 22281 ++++++++++++++++ Tests/Tests.pssproj | 9 + Tests/xSharePoint.TestHarness.psm1 | 82 + .../xSharePoint/xSharePoint.Global.Tests.ps1 | 138 +- .../xSharePoint/xSharePoint.TestHelpers.psm1 | 134 +- Tests/xSharePoint/xSharePoint.Util.Tests.ps1 | 9 +- .../xSharePoint.xSPBCSServiceApp.Tests.ps1 | 104 +- .../xSharePoint.xSPCacheAccounts.Tests.ps1 | 152 +- .../xSharePoint.xSPCreateFarm.Tests.ps1 | 150 +- ...int.xSPDiagnosticLoggingSettings.Tests.ps1 | 188 +- ...Point.xSPDistributedCacheService.Tests.ps1 | 176 +- .../xSharePoint.xSPFeature.Tests.ps1 | 194 +- .../xSharePoint.xSPInstall.Tests.ps1 | 93 +- .../xSharePoint.xSPInstallPrereqs.Tests.ps1 | 152 +- .../xSharePoint.xSPJoinFarm.Tests.ps1 | 120 +- .../xSharePoint.xSPManagedAccount.Tests.ps1 | 119 +- ...int.xSPManagedMetadataServiceApp.Tests.ps1 | 106 +- .../xSharePoint.xSPManagedPath.Tests.ps1 | 93 +- .../xSharePoint.xSPSearchServiceApp.Tests.ps1 | 110 +- ...rePoint.xSPSecureStoreServiceApp.Tests.ps1 | 109 +- .../xSharePoint.xSPServiceAppPool.Tests.ps1 | 87 +- .../xSharePoint.xSPServiceInstance.Tests.ps1 | 142 +- .../xSharePoint/xSharePoint.xSPSite.Tests.ps1 | 104 +- .../xSharePoint.xSPStateServiceApp.Tests.ps1 | 60 +- ...rePoint.xSPUserProfileServiceApp.Tests.ps1 | 111 +- ...ePoint.xSPUserProfileSyncService.Tests.ps1 | 200 +- .../xSharePoint.xSPWebApplication.Tests.ps1 | 105 +- .../xSharePoint.xSPusageApplication.Tests.ps1 | 170 +- 58 files changed, 44964 insertions(+), 1887 deletions(-) delete mode 100644 Modules/xSharePoint/Modules/xSharePoint.ServiceApplications/xSharePoint.ServiceApplications.psm1 create mode 100644 Tests/Stubs/DistributedCache/DistributedCache.psm1 create mode 100644 Tests/Stubs/SharePoint/15.0.4693.1000/Microsoft.SharePoint.PowerShell.psm1 create mode 100644 Tests/Stubs/SharePoint/16.0.4316.1217/Microsoft.SharePoint.PowerShell.psm1 create mode 100644 Tests/xSharePoint.TestHarness.psm1 diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 index 35d627fd8..00a4c102e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 @@ -10,33 +10,29 @@ function Get-TargetResource [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Getting BCS service app '$Name'" $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - try - { - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName BCS + Initialize-xSharePointPSSnapin - If ($null -eq $serviceApp) - { - return @{} - } - else - { - return @{ - Name = $serviceApp.DisplayName - ApplicationPool = $serviceApp.ApplicationPool.Name - DatabaseName = $serviceApp.Database.Name - DatabaseServer = $serviceApp.Database.Server.Name - InstallAccount = $params.InstallAccount - } + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null + } + $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq "Business Data Connectivity Service Application" } + + If ($null -eq $serviceApp) { + return $null + } else { + $returnVal = @{ + Name = $serviceApp.DisplayName + ApplicationPool = $serviceApp.ApplicationPool.Name + DatabaseName = $serviceApp.Database.Name + DatabaseServer = $serviceApp.Database.Server.Name + InstallAccount = $params.InstallAccount } - } - catch - { - return @{ } + return $returnVal } } return $result @@ -61,12 +57,12 @@ function Set-TargetResource Write-Verbose -Message "Creating BCS Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Invoke-xSharePointSPCmdlet -CmdletName "New-SPBusinessDataCatalogServiceApplication" -Arguments @{ - Name = $params.Name - ApplicationPool = $params.ApplicationPool - DatabaseName = $params.DatabaseName - DatabaseServer = $params.DatabaseServer - } + Initialize-xSharePointPSSnapin + + New-SPBusinessDataCatalogServiceApplication -Name $params.Name ` + -ApplicationPool $params.ApplicationPool ` + -DatabaseName $params.DatabaseName ` + -DatabaseServer $params.DatabaseServer } } else { @@ -74,14 +70,13 @@ function Set-TargetResource Write-Verbose -Message "Updating BCS Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName "BCS" - $appPool = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplicationPool" @{ - Identity = $params.ApplicationPool - } - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPBusinessDataCatalogServiceApplication" -Arguments @{ - Identity = $serviceApp - ApplicationPool = $appPool - } + Initialize-xSharePointPSSnapin + + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool + + Get-SPServiceApplication -Name $params.Name ` + | Where-Object { $_.TypeName -eq "Business Data Connectivity Service Application" } ` + | Set-SPBusinessDataCatalogServiceApplication -ApplicationPool $appPool } } } @@ -99,10 +94,11 @@ function Test-TargetResource [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for BCS Service Application '$Name'" - + $CurrentValues = Get-TargetResource @PSBoundParameters + + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 index 55019b467..098b24ed4 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 @@ -14,7 +14,9 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $wa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ Identity = $params.WebAppUrl } -ErrorAction SilentlyContinue + Initialize-xSharePointPSSnapin + + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { return @{} } @@ -42,9 +44,9 @@ function Set-TargetResource [CmdletBinding()] param ( - [parameter(Mandatory = $true)] [System.String] $WebAppUrl, - [parameter(Mandatory = $true)] [System.String] $SuperUserAlias, - [parameter(Mandatory = $true)] [System.String] $SuperReaderAlias, + [parameter(Mandatory = $true)] [System.String] $WebAppUrl, + [parameter(Mandatory = $true)] [System.String] $SuperUserAlias, + [parameter(Mandatory = $true)] [System.String] $SuperReaderAlias, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) @@ -52,8 +54,12 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $wa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ Identity = $params.WebAppUrl } + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue + if ($null -eq $wa) { + throw [Exception] "The web applications $($params.WebAppUrl) can not be found to set cache accounts" + } if ($wa.Properties.ContainsKey("portalsuperuseraccount")) { $wa.Properties["portalsuperuseraccount"] = $params.SuperUserAlias @@ -88,6 +94,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing cache accounts for $WebAppUrl" + if ($null -eq $CurrentValues) {return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("SuperUserAlias", "SuperReaderAlias") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 8b5cb0c82..2914acc59 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -17,17 +17,18 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin try { - $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" + $spFarm = Get-SPFarm } catch { Write-Verbose -Message "Unable to detect local farm." } - if ($null -eq $spFarm) {return @{ }} + if ($null -eq $spFarm) { return $null } - $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } - $centralAdminSite = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.IsAdministrationWebApplication })[0] + $configDb = Get-SPDatabase | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } + $centralAdminSite = Get-SPWebApplication -IncludeCentralAdministration | Where-Object { $_.IsAdministrationWebApplication -eq $true } if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { $farmAccount = $params.FarmAccount @@ -41,7 +42,7 @@ function Get-TargetResource FarmAccount = $farmAccount InstallAccount = $params.InstallAccount Passphrase = $params.Passphrase - AdminContentDatabaseName = $centralAdminSite.ContentDatabases[0].Server + AdminContentDatabaseName = $centralAdminSite.ContentDatabases[0].Name CentralAdministrationPort = [Uri]::new($centralAdminSite.Url).Port } return $returnValue @@ -67,6 +68,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin $newFarmArgs = @{ DatabaseServer = $params.DatabaseServer @@ -90,13 +92,13 @@ function Set-TargetResource } } - Invoke-xSharePointSPCmdlet -CmdletName "New-SPConfigurationDatabase" -Arguments $newFarmArgs - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPHelpCollection" -Arguments @{ All = $true } - Invoke-xSharePointSPCmdlet -CmdletName "Initialize-SPResourceSecurity" - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPService" - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPFeature" -Arguments @{ AllExistingFeatures = $true; Force = $true } - Invoke-xSharePointSPCmdlet -CmdletName "New-SPCentralAdministration" -Arguments @{ Port = $params.CentralAdministrationPort; WindowsAuthProvider = "NTLM" } - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPApplicationContent" + New-SPConfigurationDatabase @newFarmArgs + Install-SPHelpCollection -All + Initialize-SPResourceSecurity + Install-SPService + Install-SPFeature -AllExistingFeatures -Force + New-SPCentralAdministration -Port $params.CentralAdministrationPort -WindowsAuthProvider "NTLM" + Install-SPApplicationContent } } @@ -117,6 +119,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose "Checking for local farm presence" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("FarmConfigDatabaseName") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 index 9b552f8b8..c18d2e1ef 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 @@ -28,12 +28,13 @@ function Get-TargetResource Write-Verbose -Message "Getting diagnostic configuration settings" $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + Initialize-xSharePointPSSnapin - $dc = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDiagnosticConfig" -ErrorAction SilentlyContinue - if ($null -eq $dc) { return @{} } + $dc = Get-SPDiagnosticConfig -ErrorAction SilentlyContinue + if ($null -eq $dc) { return $null } return @{ - AllowLegacyTraceProviders = $dc.AllowLegacyTraceProviders AppAnalyticsAutomaticUploadEnabled = $dc.AppAnalyticsAutomaticUploadEnabled CustomerExperienceImprovementProgramEnabled = $dc.CustomerExperienceImprovementProgramEnabled ErrorReportingEnabled = $dc.ErrorReportingEnabled @@ -52,9 +53,9 @@ function Get-TargetResource ScriptErrorReportingEnabled = $dc.ScriptErrorReportingEnabled ScriptErrorReportingRequireAuth = $dc.ScriptErrorReportingRequireAuth ScriptErrorReportingDelay = $dc.ScriptErrorReportingDelay + InstallAccount = $params.InstallAccount } } - $result.Add("InstallAccount", $InstallAccount) return $result } @@ -89,12 +90,13 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } $params = $params | Rename-xSharePointParamValue -oldName "LogPath" -newName "LogLocation" ` | Rename-xSharePointParamValue -oldName "LogSpaceInGB" -newName "LogDiskSpaceUsageGB" - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPDiagnosticConfig" -Arguments $params + Set-SPDiagnosticConfig @params } } @@ -126,10 +128,9 @@ function Test-TargetResource [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - Write-Verbose -Message "Getting diagnostic configuration settings" - + Write-Verbose -Message "Testing diagnostic configuration settings" $CurrentValues = Get-TargetResource @PSBoundParameters - + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index dd771d523..2eafd31f2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -16,21 +16,23 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + $nullReturnValue = @{ + Name = $params.Name + Ensure = "Absent" + InstallAccount = $params.InstallAccount + } try { - Invoke-xSharePointDCCmdlet -CmdletName "Use-CacheCluster" -ErrorAction SilentlyContinue - $cacheHost = Invoke-xSharePointDCCmdlet -CmdletName "Get-CacheHost" -ErrorAction SilentlyContinue - if ($null -eq $cacheHost) { return @{} } + Initialize-xSharePointPSSnapin + + Use-CacheCluster -ErrorAction SilentlyContinue + $cacheHost = Get-CacheHost -ErrorAction SilentlyContinue + + if ($null -eq $cacheHost) { return $nullReturnValue } $computerName = ([System.Net.Dns]::GetHostByName($env:computerName)).HostName - $cacheHostConfig = Invoke-xSharePointDCCmdlet -CmdletName "Get-AFCacheHostConfiguration" -Arguments @{ - ComputerName = $computerName - CachePort = $cacheHost.PortNo - } -ErrorAction SilentlyContinue - if ($null -eq $cacheHostConfig) { return @{ - Name = $params.Name - Ensure = "Absent" - InstallAccount = $params.InstallAccount - } } + $cacheHostConfig = Get-AFCacheHostConfiguration -ComputerName $computerName -CachePort $cacheHost.PortNo -ErrorAction SilentlyContinue + + if ($null -eq $cacheHostConfig) { return $nullReturnValue } $windowsService = Get-WmiObject "win32_service" -Filter "Name='AppFabricCachingService'" $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -ErrorAction SilentlyContinue @@ -45,11 +47,7 @@ function Get-TargetResource } } catch{ - return @{ - Name = $params.Name - Ensure = "Absent" - InstallAccount = $params.InstallAccount - } + return $nullReturnValue } } return $result @@ -70,10 +68,10 @@ function Set-TargetResource ) $CurrentState = Get-TargetResource @PSBoundParameters - + if ($Ensure -eq "Present") { Write-Verbose -Message "Adding the distributed cache to the server" - if($createFirewallRules) { + if($createFirewallRules -eq $true) { Write-Verbose -Message "Create a firewall rule for AppFabric" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { Enable-xSharePointDCIcmpFireWallRule @@ -81,20 +79,26 @@ function Set-TargetResource } Write-Verbose -Message "Firewall rule added" } + Write-Verbose "Current state is '$($CurrentState.Ensure)' and desired state is '$Ensure'" if ($CurrentState.Ensure -ne $Ensure) { - Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + Write-Verbose -Message "Enabling distributed cache service" + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin Add-xSharePointDistributedCacheServer -CacheSizeInMB $params.CacheSizeInMB -ServiceAccount $params.ServiceAccount } } } else { Write-Verbose -Message "Removing distributed cache to the server" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { + Initialize-xSharePointPSSnapin Remove-xSharePointDistributedCacheServer } - Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { - Disable-xSharePointDCFireWallRule - } + if ($CreateFirewallRules -eq $true) { + Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { + Disable-xSharePointDCFireWallRule + } + } Write-Verbose -Message "Distributed cache removed." } } @@ -116,7 +120,8 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for distributed cache configuration" - return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("CacheSizeInMB", "Ensure", "CreateFirewallRules") + if ($null -eq $CurrentValues) { return $false } + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure", "CreateFirewallRules") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 index 19216abd2..872610d40 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 @@ -15,8 +15,9 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $feature = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFeature" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue + $feature = Get-SPFeature -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $feature) { return @{ Name = $params.Name @@ -33,7 +34,7 @@ function Get-TargetResource } else { $checkParams.Add($params.FeatureScope, $params.Url) } - $featureAtScope = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFeature" -Arguments $checkParams -ErrorAction SilentlyContinue + $featureAtScope = Get-SPFeature @checkParams -ErrorAction SilentlyContinue $enabled = ($null -ne $featureAtScope) if ($enabled) { $currentState = "Present" } else { $currentState = "Absent" } @@ -63,6 +64,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin $runParams = @{} $runParams.Add("Identity", $params.Name) @@ -71,10 +73,10 @@ function Set-TargetResource } if ($params.Ensure -eq "Present") { - Invoke-xSharePointSPCmdlet -CmdletName "Enable-SPFeature" -Arguments $runParams + Enable-SPFeature @runParams } else { $runParams.Add("Confirm", $false) - Invoke-xSharePointSPCmdlet -CmdletName "Disable-SPFeature" -Arguments $runParams + Disable-SPFeature @runParams } } } @@ -97,4 +99,5 @@ function Test-TargetResource Write-Verbose -Message "Testing for feature $Name at $FeatureScope scope" return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Ensure") } + Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 index 67eea7012..58c81bda8 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPInstallPrereqs/MSFT_xSPInstallPrereqs.psm1 @@ -49,7 +49,7 @@ function Get-TargetResource $installedItems = Get-CimInstance -ClassName Win32_Product #Common prereqs - $returnValue.Add("Microsoft Identity Extensions", (@(Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ -Recurse | ? {$_.GetValue("DisplayName") -eq "Microsoft Identity Extensions" }).Count -gt 0)) + $returnValue.Add("Microsoft Identity Extensions", (Check-xSharePointInstalledProductRegistryKey -RegKeysCollection (Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ -Recurse) -ProductName "Microsoft Identity Extensions").Count -gt 0) $returnValue.Add("Microsoft CCR and DSS Runtime 2008 R3", (($installedItems | ? {$_.Name -eq "Microsoft CCR and DSS Runtime 2008 R3"}) -ne $null)) $returnValue.Add("Microsoft Sync Framework Runtime v1.0 SP1 (x64)", (($installedItems | ? {$_.Name -eq "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"}) -ne $null)) $returnValue.Add("AppFabric 1.1 for Windows Server", (($installedItems | ? {$_.Name -eq "AppFabric 1.1 for Windows Server"}) -ne $null)) @@ -81,6 +81,17 @@ function Get-TargetResource return $results } +function Check-xSharePointInstalledProductRegistryKey() { + [CmdletBinding()] + param + ( + [parameter(Mandatory = $false)] [object] $RegKeysCollection, + [parameter(Mandatory = $true)] [string] $ProductName + ) + if ($RegKeysCollection -eq $null) { return $null } + return @($RegKeysCollection | ? {$_.GetValue("DisplayName") -eq $ProductName }) +} + function Set-TargetResource { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 index f331e358b..693b31a9e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 @@ -14,15 +14,17 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + try { - $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" -ErrorAction SilentlyContinue + $spFarm = Get-SPFarm -ErrorAction SilentlyContinue } catch { Write-Verbose -Message "Unable to detect local farm." } if ($null -eq $spFarm) {return @{ }} - $configDb = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPDatabase" -Arguments @{ IncludeCentralAdministration = $true } | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } + $configDb = Get-SPDatabase | Where-Object { $_.Name -eq $spFarm.Name -and $_.Type -eq "Configuration Database" } return @{ FarmConfigDatabaseName = $spFarm.Name @@ -50,7 +52,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $loopCount = 0 + Initialize-xSharePointPSSnapin $joinFarmArgs = @{ DatabaseServer = $params.DatabaseServer @@ -72,12 +74,12 @@ function Set-TargetResource } } - Invoke-xSharePointSPCmdlet -CmdletName "Connect-SPConfigurationDatabase" -Arguments $joinFarmArgs - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPHelpCollection" -Arguments @{ All = $true } - Invoke-xSharePointSPCmdlet -CmdletName "Initialize-SPResourceSecurity" - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPService" - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPFeature" -Arguments @{ AllExistingFeatures = $true; Force = $true } - Invoke-xSharePointSPCmdlet -CmdletName "Install-SPApplicationContent" + Connect-SPConfigurationDatabase @joinFarmArgs + Install-SPHelpCollection -All + Initialize-SPResourceSecurity + Install-SPService + Install-SPFeature -AllExistingFeatures -Force + Install-SPApplicationContent } Write-Verbose -Message "Starting timer service" diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 index 6a841c0dc..89158a88c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 @@ -16,10 +16,11 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin try { - $ma = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPManagedAccount" -Arguments @{ Identity = $params.Account.UserName } -ErrorAction SilentlyContinue - if ($null -eq $ma) { return @{ } } + $ma = Get-SPManagedAccount -Identity $params.Account.UserName -ErrorAction SilentlyContinue + if ($null -eq $ma) { return $null } return @{ AccountName = $ma.Username EmailNotification = $ma.DaysBeforeChangeToEmail @@ -29,7 +30,7 @@ function Get-TargetResource InstallAccount = $params.InstallAccount } } catch { - return @{ } + return $null } } return $result @@ -52,10 +53,11 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin $current = Get-TargetResource @params if ($current.Count -eq 0) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPManagedAccount" -Arguments @{ Credential = $params.Account } + New-SPManagedAccount -Credential $params.Account } $updateParams = @{ @@ -65,7 +67,7 @@ function Set-TargetResource if ($params.ContainsKey("PreExpireDays")) { $updateParams.Add("PreExpireDays", $params.PreExpireDays) } if ($params.ContainsKey("Schedule")) { $updateParams.Add("Schedule", $params.Schedule) } - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPManagedAccount" -Arguments $updateParams + Set-SPManagedAccount @updateParams } } @@ -86,6 +88,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing managed account $AccountName" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("AccountName", "Schedule","PreExpireDays","EmailNotification") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 index f43e09460..52d25f9b2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 @@ -15,13 +15,19 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + try { - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName MMS + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null + } + $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq "Managed Metadata Service" } If ($null -eq $serviceApp) { - return @{} + return $null } else { @@ -36,7 +42,7 @@ function Get-TargetResource } catch { - return @{ } + return $null } } return $result @@ -61,20 +67,19 @@ function Set-TargetResource Write-Verbose -Message "Creating Managed Metadata Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - $app = Invoke-xSharePointSPCmdlet -CmdletName "New-SPMetadataServiceApplication" -Arguments $params + $app = New-SPMetadataServiceApplication @params if ($null -ne $app) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPMetadataServiceApplicationProxy" -Arguments @{ - Name = ($params.Name + " Proxy") - ServiceApplication = $app - DefaultProxyGroup = $true - ContentTypePushdownEnabled = $true - DefaultKeywordTaxonomy = $true - DefaultSiteCollectionTaxonomy = $true - } + New-SPMetadataServiceApplicationProxy -Name ($params.Name + " Proxy") ` + -ServiceApplication $app ` + -DefaultProxyGroup $true ` + -ContentTypePushdownEnabled $true ` + -DefaultKeywordTaxonomy = $true ` + -DefaultSiteCollectionTaxonomy = $true } } } @@ -83,12 +88,11 @@ function Set-TargetResource Write-Verbose -Message "Updating Managed Metadata Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName MMS - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPMetadataServiceApplication" -Arguments @{ - Identity = $serviceApp - ApplicationPool = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplicationPool" -Arguments @{ Identity = $params.ApplicationPool } ) - } + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Managed Metadata Service" } + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool + Set-SPMetadataServiceApplication -Identity $serviceApp -ApplicationPool $appPool } } } @@ -110,6 +114,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for Managed Metadata Service Application '$Name'" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 index c685475ef..f9f51a59e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 @@ -15,13 +15,17 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + $getParams = @{ Identity = $params.RelativeUrl } if ($params.HostHeader) { $getParams.Add("HostHeader", $true) + } else { + $getParams.Add("WebApplication", $params.WebAppUrl) } - $path = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPManagedPath" -Arguments $getParams -ErrorAction SilentlyContinue + $path = Get-SPManagedPath @getParams -ErrorAction SilentlyContinue if ($null -eq $path) { return $null } return @{ @@ -52,6 +56,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin $path = Get-TargetResource @params -ErrorAction SilentlyContinue @@ -69,7 +74,7 @@ function Set-TargetResource $newParams.Add("RelativeURL", $params.RelativeUrl) $newParams.Add("Explicit", $params.Explicit) - Invoke-xSharePointSPCmdlet -CmdletName "New-SPManagedPath" -Arguments $newParams + New-SPManagedPath @newParams } } } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 index 04a63ca48..43af1b72c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 @@ -15,22 +15,25 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName Search - - If ($null -eq $serviceApp) - { - return @{} + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null } - else - { - return @{ + $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq "Search Service Application" } + + If ($null -eq $serviceApp) { + return $null + } else { + $returnVal = @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name DatabaseName = $serviceApp.Database.Name DatabaseServer = $serviceApp.Database.Server.Name InstallAccount = $params.InstallAccount } + return $returnVal } } return $result @@ -48,37 +51,33 @@ function Set-TargetResource [parameter(Mandatory = $false)] [System.String] $DatabaseName, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount ) - $result = Get-TargetResource @PSBoundParameters - if ($result.Count -eq 0) { + if ($result -eq $null) { Write-Verbose -Message "Creating Search Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - $serviceInstance = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPEnterpriseSearchServiceInstance" -Arguments @{ Local = $true } - Invoke-xSharePointSPCmdlet -CmdletName "Start-SPEnterpriseSearchServiceInstance" -Arguments @{ Identity = $serviceInstance } -ErrorAction SilentlyContinue - $app = Invoke-xSharePointSPCmdlet -CmdletName "New-SPEnterpriseSearchServiceApplication" -Arguments $params + $serviceInstance = Get-SPEnterpriseSearchServiceInstance -Local + Start-SPEnterpriseSearchServiceInstance -Identity $serviceInstance -ErrorAction SilentlyContinue + $app = New-SPEnterpriseSearchServiceApplication @params if ($app) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPEnterpriseSearchServiceApplicationProxy" -Arguments @{ - Name = "$($params.Name) Proxy" - SearchApplication = $app - } + New-SPEnterpriseSearchServiceApplicationProxy -Name "$($params.Name) Proxy" -SearchApplication $app } } - } - else { + } else { if ([string]::IsNullOrEmpty($ApplicationPool) -eq $false -and $ApplicationPool -ne $result.ApplicationPool) { Write-Verbose -Message "Updating Search Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName Search - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPEnterpriseSearchServiceApplication" -Arguments @{ - Identity = $serviceApp - ApplicationPool = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplicationPool" -Arguments @{ Identity = $params.ApplicationPool } ) - } + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Search Service Application" } + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool + Set-SPEnterpriseSearchServiceApplication -Identity $serviceApp -ApplicationPool $appPool } } } @@ -100,6 +99,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing Search service application '$Name'" + If ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 index 66c43cf81..26e402f6b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 @@ -23,22 +23,25 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName SecureStore - - If ($null -eq $serviceApp) - { - return @{} + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null } - else - { - return @{ + $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq "Secure Store Service Application" } + + If ($null -eq $serviceApp) { + return $null + } else { + $returnVal = @{ Name = $serviceApp.DisplayName ApplicationPool = $serviceApp.ApplicationPool.Name DatabaseName = $serviceApp.Database.Name DatabaseServer = $serviceApp.Database.Server.Name InstallAccount = $params.InstallAccount } + return $returnVal } } return $result @@ -71,14 +74,23 @@ function Set-TargetResource Write-Verbose -Message "Creating Secure Store Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - $app = Invoke-xSharePointSPCmdlet -CmdletName "New-SPSecureStoreServiceApplication" -Arguments $params - if ($app) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPSecureStoreServiceApplicationProxy" -Arguments @{ - Name = "$($params.Name) Proxy" - ServiceApplication = $app + switch((Get-xSharePointInstalledProductVersion).FileMajorPart) { + 15 { + $app = New-SPSecureStoreServiceApplication @params + } + 16 { + $app = New-SPSecureStoreServiceApplication @params -EnableMinDB:$false } + Default { + throw [Exception] "An unknown version of SharePoint (Major version $_) was detected. Only versions 15 (SharePoint 2013) or 16 (SharePoint 2016) are supported." + } + } + if ($app) { + New-SPSecureStoreServiceApplicationProxy -Name "$($params.Name) Proxy" -ServiceApplication $app } } } else { @@ -86,11 +98,20 @@ function Set-TargetResource Write-Verbose -Message "Updating Secure Store Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName SecureStore - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPSecureStoreServiceApplication" -Arguments @{ - Identity = $serviceApp - ApplicationPool = (Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplicationPool" -Arguments @{ Identity = $params.ApplicationPool } ) + Initialize-xSharePointPSSnapin + + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Secure Store Service Application" } + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool + switch((Get-xSharePointInstalledProductVersion).FileMajorPart) { + 15 { + Set-SPSecureStoreServiceApplication -Identity $serviceApp -ApplicationPool $appPool + } + 16 { + Set-SPSecureStoreServiceApplication -Identity $serviceApp -ApplicationPool $appPool -EnableMinDB:$false + } + Default { + throw [Exception] "An unknown version of SharePoint (Major version $_) was detected. Only versions 15 (SharePoint 2013) or 16 (SharePoint 2016) are supported." + } } } } @@ -121,6 +142,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing secure store service application $Name" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 index 6144d43ff..cf028547e 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 @@ -13,9 +13,10 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $sap = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplicationPool" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue - if ($null -eq $sap) { return @{} } + $sap = Get-SPServiceApplicationPool -Identity $params.Name -ErrorAction SilentlyContinue + if ($null -eq $sap) { return $null } return @{ Name = $sap.Name @@ -41,19 +42,14 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $sap = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplicationPool" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue + $sap = Get-SPServiceApplicationPool -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $sap) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPServiceApplicationPool" -Arguments @{ - Name = $params.Name - Account = $params.ServiceAccount - } + New-SPServiceApplicationPool -Name $params.Name -Account $params.ServiceAccount } else { if ($sap.ProcessAccountName -ne $params.ServiceAccount) { - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPServiceApplicationPool" -Arguments @{ - Identity = $params.Name - Account = $params.ServiceAccount - } + Set-SPServiceApplicationPool -Identity $params.Name -Account $params.ServiceAccount } } } @@ -73,6 +69,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing service application pool '$Name'" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ServiceAccount") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 index b11621860..024b0b74b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 @@ -13,9 +13,14 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $si = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq $params.Name } - if ($null -eq $si) { return @{} } + $si = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq $params.Name } + if ($null -eq $si) { return @{ + Name = $params.Name + Ensure = "Absent" + InstallAccount = $params.InstallAccount + } } if ($si.Status -eq "Online") { $localEnsure = "Present" } else { $localEnsure = "Absent" } return @{ @@ -43,20 +48,26 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $si = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq $params.Name } - if ($null -eq $si) { return $false } - Invoke-xSharePointSPCmdlet -CmdletName "Start-SPServiceInstance" -Arguments @{ Identity = $si } + $si = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq $params.Name } + if ($null -eq $si) { + throw [Exception] "Unable to locate service application '$($params.Name)'" + } + Start-SPServiceInstance -Identity $si } } else { Write-Verbose -Message "Deprovioning service instance '$Name'" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $si = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq $params.Name } - if ($null -eq $si) { return $false } - Invoke-xSharePointSPCmdlet -CmdletName "Stop-SPServiceInstance" -Arguments @{ Identity = $si } + $si = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq $params.Name } + if ($null -eq $si) { + throw [Exception] "Unable to locate service application '$($params.Name)'" + } + Stop-SPServiceInstance -Identity $si } } } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 index 071f3ba30..c4ccb2ae8 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 @@ -24,10 +24,12 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $site = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPSite" -Arguments @{ Identity = $params.Url } -ErrorAction SilentlyContinue + Initialize-xSharePointPSSnapin + + $site = Get-SPSite -Identity $params.Url -ErrorAction SilentlyContinue if ($null -eq $site) { - return @{} + return $null } else { if ($site.HostHeaderIsSiteName) { $HostHeaderWebApplication = $site.WebApplication.Url } @@ -35,7 +37,7 @@ function Get-TargetResource $owner = $null } else { if ($site.WebApplication.UseClaimsAuthentication) { - $owner = (Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.Owner.UserLogin; IdentityType = "EncodedClaim" }).Value + $owner = (New-SPClaimsPrincipal -Identity $site.Owner.UserLogin -IdentityType "EncodedClaim").Value } else { $owner = $site.Owner.UserLogin } @@ -45,7 +47,7 @@ function Get-TargetResource $secondaryOwner = $null } else { if ($site.WebApplication.UseClaimsAuthentication) { - $secondaryOwner = (Invoke-xSharePointSPCmdlet -CmdletName "New-SPClaimsPrincipal" -Arguments @{ Identity = $site.SecondaryContact.UserLogin; IdentityType = "EncodedClaim" }).Value + $secondaryOwner = (New-SPClaimsPrincipal -Identity $site.SecondaryContact.UserLogin -IdentityType "EncodedClaim").Value } else { $secondaryOwner = $site.SecondaryContact.UserLogin } @@ -98,12 +100,14 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + $params.Remove("InstallAccount") | Out-Null - $site = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPSite" -Arguments @{ Identity = $params.Url } -ErrorAction SilentlyContinue + $site = Get-SPSite -Identity $params.Url -ErrorAction SilentlyContinue if ($null -eq $site) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPSite" -Arguments $params | Out-Null + New-SPSite @params | Out-Null } } } @@ -133,6 +137,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing site collection $Url" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Url") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 index d8a211046..b33990c45 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 @@ -5,7 +5,7 @@ function Get-TargetResource param ( [parameter(Mandatory = $true)] [System.String] $Name, - [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseName, [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount @@ -15,10 +15,11 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPStateServiceApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue + $serviceApp = Get-SPStateServiceApplication -Identity $params.Name -ErrorAction SilentlyContinue - if ($null -eq $serviceApp) { return @{} } + if ($null -eq $serviceApp) { return $null } return @{ Name = $serviceApp.DisplayName @@ -37,7 +38,7 @@ function Set-TargetResource param ( [parameter(Mandatory = $true)] [System.String] $Name, - [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseName, [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount @@ -47,8 +48,9 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $app = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPStateServiceApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue + $app = Get-SPStateServiceApplication -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $app) { $dbParams = @{} @@ -56,9 +58,9 @@ function Set-TargetResource if ($params.ContainsKey("DatabaseServer")) { $dbParams.Add("DatabaseServer", $params.DatabaseServer) } if ($params.ContainsKey("DatabaseCredentials")) { $dbParams.Add("DatabaseCredentials", $params.DatabaseCredentials) } - $database = Invoke-xSharePointSPCmdlet -CmdletName "New-SPStateServiceDatabase" -Arguments $dbParams - $app = Invoke-xSharePointSPCmdlet -CmdletName "New-SPStateServiceApplication" -Arguments @{ Name = $params.Name; Database = $database } - Invoke-xSharePointSPCmdlet -CmdletName "New-SPStateServiceApplicationProxy" -Arguments @{ ServiceApplication = $app; DefaultProxyGroup = $true } + $database = New-SPStateServiceDatabase @dbParams + $app = New-SPStateServiceApplication -Name $params.Name -Database $database + New-SPStateServiceApplicationProxy -ServiceApplication $app -DefaultProxyGroup | Out-Null } } } @@ -71,7 +73,7 @@ function Test-TargetResource param ( [parameter(Mandatory = $true)] [System.String] $Name, - [parameter(Mandatory = $false)] [System.String] $DatabaseName, + [parameter(Mandatory = $true)] [System.String] $DatabaseName, [parameter(Mandatory = $false)] [System.String] $DatabaseServer, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $DatabaseCredentials, [parameter(Mandatory = $false)] [System.Management.Automation.PSCredential] $InstallAccount @@ -79,6 +81,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for state service application $Name" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof index 83324d67e..c068a9051 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.schema.mof @@ -3,7 +3,7 @@ class MSFT_xSPStateServiceApp : OMI_BaseResource { [Key] string Name; [Write, EmbeddedInstance("MSFT_Credential")] String DatabaseCredentials; - [Write] string DatabaseName; + [Required] string DatabaseName; [Write] string DatabaseServer; [Write, EmbeddedInstance("MSFT_Credential")] String InstallAccount; }; diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 index 6ceb37fc5..e9ea867a5 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 @@ -21,16 +21,21 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName Usage + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null + } + $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq "Usage and Health Data Collection Service Application" } If ($null -eq $serviceApp) { - return @{} + return $null } else { - $service = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPUsageService" + $service = Get-SPUsageService return @{ Name = $serviceApp.DisplayName InstallAccount = $params.InstallAccount @@ -70,12 +75,13 @@ function Set-TargetResource Write-Verbose -Message "Setting usage application $Name" - Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { - $params = $args[0] - - $app = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplication" -Arguments @{ Name = $params.Name } -ErrorAction SilentlyContinue + $CurrentState = Get-TargetResource @PSBoundParameters - if ($null -eq $app) { + if ($null -eq $CurrentState) { + Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { + $params = $args[0] + Initialize-xSharePointPSSnapin + $newParams = @{} $newParams.Add("Name", $params.Name) if ($params.ContainsKey("DatabaseName")) { $newParams.Add("DatabaseName", $params.DatabaseName) } @@ -84,20 +90,22 @@ function Set-TargetResource if ($params.ContainsKey("DatabaseUsername")) { $newParams.Add("DatabaseUsername", $params.DatabaseUsername) } if ($params.ContainsKey("FailoverDatabaseServer")) { $newParams.Add("FailoverDatabaseServer", $params.FailoverDatabaseServer) } - Invoke-xSharePointSPCmdlet -CmdletName "New-SPUsageApplication" -Arguments $newParams + New-SPUsageApplication @newParams } } Write-Verbose -Message "Configuring usage application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + $setParams = @{} $setParams.Add("LoggingEnabled", $true) if ($params.ContainsKey("UsageLogCutTime")) { $setParams.Add("UsageLogCutTime", $params.UsageLogCutTime) } if ($params.ContainsKey("UsageLogLocation")) { $setParams.Add("UsageLogLocation", $params.UsageLogLocation) } if ($params.ContainsKey("UsageLogMaxFileSizeKB")) { $setParams.Add("UsageLogMaxFileSizeKB", $params.UsageLogMaxFileSizeKB) } if ($params.ContainsKey("UsageLogMaxSpaceGB")) { $setParams.Add("UsageLogMaxSpaceGB", $params.UsageLogMaxSpaceGB) } - Invoke-xSharePointSPCmdlet -CmdletName "Set-SPUsageService" -Arguments $setParams + Set-SPUsageService @setParams } } @@ -123,6 +131,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for usage application '$Name'" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("UsageLogCutTime", "UsageLogLocation", "UsageLogMaxFileSizeKB", "UsageLogMaxSpaceGB") } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 index 516eae2ac..296834a8c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 @@ -21,27 +21,22 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName UserProfile + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null + } + $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq "User Profile Service Application" } If ($null -eq $serviceApp) { - return @{} + return $null } else { - $propData = $serviceApp.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic) - - $socialProp = $propData | Where-Object {$_.Name -eq "SocialDatabase"} - $socialDB = $socialProp.GetValue($serviceApp) - - $profileProp = $propData | Where-Object {$_.Name -eq "ProfileDatabase"} - $profileDB = $profileProp.GetValue($serviceApp) - - $syncProp = $propData | Where-Object {$_.Name -eq "SynchronizationDatabase"} - $syncDB = $syncProp.GetValue($serviceApp) - - $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" + $databases = Get-UserProfileServiceProperties $serviceApp + $spFarm = Get-SPFarm if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { $farmAccount = $params.FarmAccount @@ -54,12 +49,12 @@ function Get-TargetResource ApplicationPool = $serviceApp.ApplicationPool.Name FarmAccount = $farmAccount MySiteHostLocation = $params.MySiteHostLocation - ProfileDBName = $profileProp.Name - ProfileDBServer = $profileProp.Server.Name - SocialDBName = $socialDB.Name - SocialDBServer = $socialDB.Server.Name - SyncDBName = $syncDB.Name - SyncDBServer = $syncDB.Server.Name + ProfileDBName = $databases.ProfileDatabase.Name + ProfileDBServer = $databases.ProfileDatabase.Server.Name + SocialDBName = $databases.SocialDatabase.Name + SocialDBServer = $databases.SocialDatabase.Server.Name + SyncDBName = $databases.SynchronizationDatabase.Name + SyncDBServer = $databases.SynchronizationDatabase.Server.Name InstallAccount = $params.InstallAccount } } @@ -67,6 +62,27 @@ function Get-TargetResource return $result } +function Get-UserProfileServiceProperties() { + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [parameter(Mandatory = $true)] [System.String] $serviceApp + ) + $results = @{} + $propData = $serviceApp.GetType().GetProperties([System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic) + + $socialProp = $propData | Where-Object {$_.Name -eq "SocialDatabase"} + $results.Add("SocialDatabase", $socialProp.GetValue($serviceApp)) + + $profileProp = $propData | Where-Object {$_.Name -eq "ProfileDatabase"} + $results.Add("ProfileDatabase", $profileProp.GetValue($serviceApp)) + + $syncProp = $propData | Where-Object {$_.Name -eq "SynchronizationDatabase"} + $results.Add("SynchronizationDatabase", $syncProp.GetValue($serviceApp)) + + return $results +} function Set-TargetResource { @@ -98,21 +114,19 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $FarmAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } $params.Remove("FarmAccount") | Out-Null $params = Rename-xSharePointParamValue -params $params -oldName "SyncDBName" -newName "ProfileSyncDBName" $params = Rename-xSharePointParamValue -params $params -oldName "SyncDBServer" -newName "ProfileSyncDBServer" - $serviceApp = Get-xSharePointServiceApplication -Name $params.Name -TypeName UserProfile - if ($null -eq $serviceApp) { - $app = Invoke-xSharePointSPCmdlet -CmdletName "New-SPProfileServiceApplication" -Arguments $params + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + $app = New-SPProfileServiceApplication @params if ($null -ne $app) { - Invoke-xSharePointSPCmdlet -CmdletName "New-SPProfileServiceApplicationProxy" -Arguments @{ - Name = "$($params.Name) Proxy" - ServiceApplication = $app - DefaultProxyGroup = $true - } + New-SPProfileServiceApplicationProxy -Name "$($params.Name) Proxy" -ServiceApplication $app -DefaultProxyGroup } } } @@ -146,7 +160,8 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for user profile service application $Name" - return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") + if ($null -eq $CurrentValues) { return $false } + return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("Name") } Export-ModuleMember -Function *-TargetResource diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index 24bbf1415..00ecf09a5 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -13,23 +13,28 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $syncService = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq (Get-xSharePointServiceApplicationName -Name UserProfileSync) } - - if ($syncService.UserProfileApplicationGuid -ne [Guid]::Empty) { - $upa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Identity = $syncService.UserProfileApplicationGuid } -ErrorAction SilentlyContinue - } - if ($null -eq $syncService) { return @{} } + $syncService = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq "User Profile Synchronization Service" } + if ($null -eq $syncService) { return @{ + UserProfileServiceAppName = $params.UserProfileServiceAppName + Ensure = "Absent" + FarmAccount = $params.FarmAccount + InstallAccount = $params.InstallAccount + } } + if ($syncService.UserProfileApplicationGuid -ne $null -and $syncService.UserProfileApplicationGuid -ne [Guid]::Empty) { + $upa = Get-SPServiceInstance -Identity $syncService.UserProfileApplicationGuid -ErrorAction SilentlyContinue + } if ($syncService.Status -eq "Online") { $localEnsure = "Present" } else { $localEnsure = "Absent" } - $spFarm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" + $spFarm = Get-SPFarm - if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { - $farmAccount = $params.FarmAccount - } else { - $farmAccount = $spFarm.DefaultServiceAccount.Name - } + if ($params.FarmAccount.UserName -eq $spFarm.DefaultServiceAccount.Name) { + $farmAccount = $params.FarmAccount + } else { + $farmAccount = $spFarm.DefaultServiceAccount.Name + } return @{ UserProfileServiceAppName = $upa.Name @@ -69,20 +74,20 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $FarmAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $syncService = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq (Get-xSharePointServiceApplicationName -Name UserProfileSync) } + $syncService = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq "User Profile Synchronization Service" } # Start the Sync service if it should be running on this server if (($params.Ensure -eq "Present") -and ($syncService.Status -ne "Online")) { - Set-xSharePointUserProfileSyncMachine -UserProfileServiceAppName $params.UserProfileServiceAppName -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount - Invoke-xSharePointSPCmdlet -CmdletName "Start-SPServiceInstance" -Arguments @{ Identity = $syncService.ID } + Start-SPServiceInstance -Identity $syncService.ID $desiredState = "Online" } # Stop the Sync service in all other cases else { - Invoke-xSharePointSPCmdlet -CmdletName "Stop-SPServiceInstance" -Arguments @{ Identity = $syncService.ID; Confirm = $false } + Stop-SPServiceInstance -Identity $syncService.ID -Confirm:$false $desiredState = "Disabled" } @@ -92,7 +97,7 @@ function Set-TargetResource while (($count -lt $maxCount) -and ($syncService.Status -ne $desiredState)) { # Get the current status of the Sync service - $syncService = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" -Arguments @{ Server = $env:COMPUTERNAME } | Where-Object { $_.TypeName -eq (Get-xSharePointServiceApplicationName -Name UserProfileSync) } + $syncService = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq "User Profile Synchronization Service" } if ($syncService.Status -ne $desiredState) { Start-Sleep -Seconds 60 } $count++ diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index 26d68d859..e61dc48a5 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -22,11 +22,12 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] + Initialize-xSharePointPSSnapin - $wa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue - if ($null -eq $wa) { return @{} } + $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue + if ($null -eq $wa) { return $null } - $authProvider = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPAuthenticationProvider" -Arguments @{ WebApplication = $wa.Url; Zone = "Default" } + $authProvider = Get-SPAuthenticationProvider -WebApplication $wa.Url -Zone "Default" if ($authProvider.DisableKerberos -eq $true) { $localAuthMode = "NTLM" } else { $localAuthMode = "Kerberos" } @@ -72,29 +73,27 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - - if ($AuthenticationMethod -eq "NTLM") { - $ap = Invoke-xSharePointSPCmdlet -CmdletName "New-SPAuthenticationProvider" -Arguments @{ - UseWindowsIntegratedAuthentication = $true - DisableKerberos = $true - } - } else { - $ap = Invoke-xSharePointSPCmdlet -CmdletName "New-SPAuthenticationProvider" -Arguments @{ - UseWindowsIntegratedAuthentication = $true + Initialize-xSharePointPSSnapin + + $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue + if ($null -eq $wa) { + if ($params.ContainsKey("AuthenticationMethod") -eq $true) { + if ($params.AuthenticationMethod -eq "NTLM") { + $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos + } else { + $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication + } + $params.Remove("AuthenticationMethod") + $params.Add("AuthenticationProvider", $ap) } - } - $params.Add("AuthenticationProvider", $ap) - - $wa = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPWebApplication" -Arguments @{ Identity = $params.Name } -ErrorAction SilentlyContinue - if ($null -eq $wa) { + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } - if ($params.ContainsKey("AuthenticationMethod")) { $params.Remove("AuthenticationMethod") | Out-Null } if ($params.ContainsKey("AllowAnonymous")) { $params.Remove("AllowAnonymous") | Out-Null $params.Add("AllowAnonymousAccess", $true) } - Invoke-xSharePointSPCmdlet -CmdletName "New-SPWebApplication" -Arguments $params + New-SPWebApplication @params } } } @@ -122,6 +121,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters Write-Verbose -Message "Testing for web application '$Name'" + if ($null -eq $CurrentValues) { return $false } return Test-xSharePointSpecificParameters -CurrentValues $CurrentValues -DesiredValues $PSBoundParameters -ValuesToCheck @("ApplicationPool") } diff --git a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 index 7bb49b1da..c77b28fee 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 @@ -10,62 +10,41 @@ function Add-xSharePointDistributedCacheServer() { [System.String] $ServiceAccount ) + Initialize-xSharePointPSSnapin - Invoke-xSharePointSPCmdlet -CmdletName "Add-SPDistributedCacheServiceInstance" - Invoke-xSharePointSPCmdlet -CmdletName "Update-SPDistributedCacheSize" -Arguments @{ CacheSizeInMB = $CacheSizeInMB } + Add-SPDistributedCacheServiceInstance + Update-SPDistributedCacheSize -CacheSizeInMB $CacheSizeInMB - $farm = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPFarm" - $cacheService = $farm.Services | Where-Object {$_.Name -eq "AppFabricCachingService"} + $farm = Get-SPFarm + $cacheService = $farm.Services | Where-Object { $_.Name -eq "AppFabricCachingService" } $cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser" - $account = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPManagedAccount" -Arguments @{ Identity = $ServiceAccount } + + $account = Get-SPManagedAccount -Identity $ServiceAccount $cacheService.ProcessIdentity.ManagedAccount = $account - $cacheService.ProcessIdentity.Update() - $cacheService.ProcessIdentity.Deploy() -} -function Remove-xSharePointDistributedCacheServer() { - $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" - $serviceInstance = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceInstance" | Where-Object {($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername} - $serviceInstance.Delete() - Invoke-xSharePointSPCmdlet -CmdletName "Remove-SPDistributedCacheServiceInstance" + Update-xSharePointDistributedCacheService -CacheService $cacheService } -function Invoke-xSharePointDCCmdlet() { +function Update-xSharePointDistributedCacheService() { [CmdletBinding()] param ( [parameter(Mandatory = $true,Position=1)] - [string] - $CmdletName, - - [parameter(Mandatory = $false,Position=2)] - [HashTable] - $Arguments + [object] + $CacheService ) + $CacheService.ProcessIdentity.Update() + $CacheService.ProcessIdentity.Deploy() +} - Write-Verbose "Preparing to execute SharePoint command - $CmdletName" - - if ($null -ne $Arguments -and $Arguments.Count -gt 0) { - $argumentsString = "" - $Arguments.Keys | ForEach-Object { - $argumentsString += "$($_): $($Arguments.$_); " - } - Write-Verbose "Arguments for $CmdletName - $argumentsString" - } - - if ($null -eq $Arguments) { - $script = ([scriptblock]::Create("$CmdletName; `$params = `$null")) - $result = Invoke-Command -ScriptBlock $script -NoNewScope - } else { - $script = ([scriptblock]::Create("`$params = `$args[0]; $CmdletName @params; `$params = `$null")) - $result = Invoke-Command -ScriptBlock $script -ArgumentList $Arguments -NoNewScope - } - return $result +function Remove-xSharePointDistributedCacheServer() { + $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" + $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername } + $serviceInstance.Delete() + Remove-SPDistributedCacheServiceInstance } function Enable-xSharePointDCIcmpFireWallRule() { - Import-Module -Name NetSecurity - $firewallRule = Get-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -ErrorAction SilentlyContinue if($null -eq $firewallRule) { New-NetFirewallRule -Name Allow_Ping -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -Description "Allow ICMPv4 ping" -Protocol ICMPv4 -IcmpType 8 -Enabled True -Profile Any -Action Allow @@ -74,8 +53,6 @@ function Enable-xSharePointDCIcmpFireWallRule() { } function Enable-xSharePointDCFireWallRule() { - Import-Module -Name NetSecurity - $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -ErrorAction SilentlyContinue if($null -eq $firewallRule) { New-NetFirewallRule -Name "SPDistCache" -DisplayName "SharePoint Distributed Cache" -Protocol TCP -LocalPort 22233-22236 -Group "SharePoint" @@ -84,12 +61,10 @@ function Enable-xSharePointDCFireWallRule() { } function Disable-xSharePointDCFireWallRule() { - Import-Module -Name NetSecurity - $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distribute Cache" -ErrorAction SilentlyContinue - if($null -eq $firewallRule) { + if($null -ne $firewallRule) { Write-Verbose -Message "Disabling firewall rules." - Disable-NetFirewallRule -DisplayName -DisplayName "SharePoint Distribute Cache" + Disable-NetFirewallRule -DisplayName "SharePoint Distribute Cache" } } diff --git a/Modules/xSharePoint/Modules/xSharePoint.ServiceApplications/xSharePoint.ServiceApplications.psm1 b/Modules/xSharePoint/Modules/xSharePoint.ServiceApplications/xSharePoint.ServiceApplications.psm1 deleted file mode 100644 index 20ece3aa5..000000000 --- a/Modules/xSharePoint/Modules/xSharePoint.ServiceApplications/xSharePoint.ServiceApplications.psm1 +++ /dev/null @@ -1,39 +0,0 @@ -function Get-xSharePointServiceApplication() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [string] - $Name, - - [parameter(Mandatory = $true,Position=2)] - [ValidateSet("BCS", "MMS", "Search", "SecureStore", "Usage", "UserProfile", "UserProfileSync")] - [string] - $TypeName - ) - - $serviceApps = Invoke-xSharePointSPCmdlet -CmdletName "Get-SPServiceApplication" -Arguments @{ Name = $Name } -ErrorAction SilentlyContinue - $serviceApp = $serviceApps | Where-Object { $_.TypeName -eq (Get-xSharePointServiceApplicationName -Name $TypeName) } - return $serviceApp -} - -function Get-xSharePointServiceApplicationName() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [string] - $Name - ) - Switch($Name) { - "BCS" { return "Business Data Connectivity Service Application" } - "MMS" { return "Managed Metadata Service" } - "Search" { return "Search Service Application" } - "SecureStore" { return "Secure Store Service Application" } - "Usage" { return "Usage and Health Data Collection Service Application" } - "UserProfile" { return "User Profile Service Application" } - "UserProfileSync" { return "User Profile Synchronization Service" } - } -} - -Export-ModuleMember -Function * diff --git a/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 b/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 index db26e77f7..d052d5188 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 @@ -63,7 +63,11 @@ function Set-xSharePointUserProfileSyncMachine() { [PSCredential] $FarmAccount ) - $ups = Get-xSharePointServiceApplication -Name $UserProfileServiceAppName -TypeName UserProfile + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + return $null + } + $ups = $serviceApps | Where-Object { $_.TypeName -eq "User Profile Service Application" } $ups.SetSynchronizationMachine($env:COMPUTERNAME, $SyncServiceId, $FarmAccount.UserName, $FarmAccount.GetNetworkCredential().Password) } diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 956b6b43d..8be3d0114 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -31,7 +31,7 @@ function Invoke-xSharePointCommand() { } Write-Verbose "Executing as the local run as user $($Env:USERDOMAIN)\$($Env:USERNAME)" - $result = Invoke-Command @invokeArgs + $result = Invoke-Command @invokeArgs -Verbose return $result } else { if ($Credential.UserName.Split("\")[1] -eq $Env:USERNAME) { @@ -49,7 +49,7 @@ function Invoke-xSharePointCommand() { if ($session) { $invokeArgs.Add("Session", $session) } - $result = Invoke-Command @invokeArgs + $result = Invoke-Command @invokeArgs -Verbose if ($session) { Remove-PSSession $session } return $result diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 2f600eaad..800950a2a 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -65,7 +65,6 @@ Description = 'This DSC module is used to deploy and configure SharePoint Server # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @("modules\xSharePoint.CacheAccounts\xSharePoint.CacheAccounts.psm1", "modules\xSharePoint.DistributedCache\xSharePoint.DistributedCache.psm1", - "modules\xSharePoint.ServiceApplications\xSharePoint.ServiceApplications.psm1", "modules\xSharePoint.UserProfileService\xSharePoint.UserProfileService.psm1", "modules\xSharePoint.Util\xSharePoint.Util.psm1") @@ -79,10 +78,8 @@ CmdletsToExport = @("Add-xSharePointDistributedCacheServer", "Initialize-xSharePointPSSnapin", "Get-xSharePointInstalledProductVersion", "Invoke-xSharePointSPCmdlet", - "Invoke-xSharePointDCCmdlet", "Rename-xSharePointParamValue", "Update-xSharePointObject", - "Get-xSharePointServiceApplication", "Set-xSharePointCacheReaderPolicy", "Set-xSharePointCacheOwnerPolicy", "Enable-xSharePointDCIcmpFireWallRule", diff --git a/Modules/xSharePoint/xSharePoint.pssproj b/Modules/xSharePoint/xSharePoint.pssproj index b4031619c..f246942c2 100644 --- a/Modules/xSharePoint/xSharePoint.pssproj +++ b/Modules/xSharePoint/xSharePoint.pssproj @@ -77,7 +77,6 @@ - @@ -128,7 +127,6 @@ - diff --git a/Tests/Stubs/DistributedCache/DistributedCache.psm1 b/Tests/Stubs/DistributedCache/DistributedCache.psm1 new file mode 100644 index 000000000..48ff644a8 --- /dev/null +++ b/Tests/Stubs/DistributedCache/DistributedCache.psm1 @@ -0,0 +1,18 @@ +function Use-CacheCluster() { + +} + +function Get-CacheHost() { + +} + +function Get-AFCacheHostConfiguration() { +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${ComputerName}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [uint32] + ${CachePort}) +} \ No newline at end of file diff --git a/Tests/Stubs/SharePoint/15.0.4693.1000/Microsoft.SharePoint.PowerShell.psm1 b/Tests/Stubs/SharePoint/15.0.4693.1000/Microsoft.SharePoint.PowerShell.psm1 new file mode 100644 index 000000000..e9b7bbe93 --- /dev/null +++ b/Tests/Stubs/SharePoint/15.0.4693.1000/Microsoft.SharePoint.PowerShell.psm1 @@ -0,0 +1,20554 @@ +function Add-DatabaseToAvailabilityGroup { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AGName}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='AllDatabases', Mandatory=$true)] + [switch] + ${ProcessAllDatabases}, + + [string] + ${FileShare}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPAppDeniedEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Endpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPClaimTypeMapping { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [ValidateNotNull()] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPDiagnosticsPerformanceCounter { + [CmdletBinding(DefaultParameterSetName='AddCounter', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AddInstance', Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ParameterSetName='AddInstance', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [switch] + ${AllInstances}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPDistributedCacheServiceInstance { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPEduClassMember { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${UserAlias}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${ClassId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Role}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPEduUser { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${UserAlias}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Role}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${FirstName}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${LastName}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${UserEmail}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPInfoPathUserAgent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPPluggableSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(Mandatory=$true)] + [int] + ${PlugInId}, + + [string] + ${QualifiedTypeName}, + + [System.Collections.Specialized.NameValueCollection] + ${CustomProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPProfileLeader { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPProfileSyncConnection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionForestName}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionDomain}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionUserName}, + + [Parameter(Mandatory=$true)] + [securestring] + ${ConnectionPassword}, + + [string] + ${ConnectionServerName}, + + [int] + ${ConnectionPort}, + + [bool] + ${ConnectionUseSSL}, + + [bool] + ${ConnectionUseDisabledFilter}, + + [string] + ${ConnectionNamingContext}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionSynchronizationOU}, + + [string] + ${ConnectionClaimProviderTypeValue}, + + [string] + ${ConnectionClaimProviderIdValue}, + + [string] + ${ConnectionClaimIDMapAttribute}, + + [bool] + ${ConnectionFilterOutUnlicensed}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Availability}, + + [ValidateNotNull()] + [object] + ${OutgoingScheme}, + + [System.Nullable[int]] + ${OutgoingPort}, + + [ValidateNotNull()] + [System.Nullable[double]] + ${StaticWeight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${MachineTargets}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [object] + ${MachinePool}, + + [ValidateNotNull()] + [System.Nullable[int]] + ${ExecutionGroup}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseFailoverServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSecureStoreSystemAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${AccountName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseFailoverServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPServiceApplicationProxyGroupMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [Alias('Proxy')] + [ValidateNotNull()] + [object] + ${Member}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPShellAdmin { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${UserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSiteSubscriptionFeaturePackMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${FeatureDefinition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [string] + ${SynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${LiteralPath}, + + [uint32] + ${Language}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [ValidateNotNull()] + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Threshold}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPUserLicenseMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Mapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${LiteralPath}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPConfigurationDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet')] +param( + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [string] + ${Directory}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPEnterpriseSearchServiceApplicationIndex { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='RunBackup', Mandatory=$true, Position=0)] + [int] + ${Phase}, + + [Parameter(ParameterSetName='AbortBackup', Mandatory=$true, Position=0)] + [switch] + ${Abort}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='RunBackup', Mandatory=$true, Position=2)] + [string] + ${BackupFolder}, + + [Parameter(Mandatory=$true, Position=3)] + [string] + ${BackupHandleFile}, + + [Parameter(Position=4)] + [int] + ${Retries}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPFarm { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [string] + ${Directory}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [ValidateSet('Full','Differential','None')] + [string] + ${BackupMethod}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${BackupThreads}, + + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${Force}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [switch] + ${ConfigurationOnly}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${Percentage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${UseSqlSnapshot}, + + [switch] + ${NoSiteLock}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPAppDeniedEndpointList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPDistributedCacheItem { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPLogLevel { + [CmdletBinding()] +param( + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPMetadataWebServicePartitionData { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceProxy}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [object] + ${TrustedLocationType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPScaleOutDatabaseDeletedDataSubRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPScaleOutDatabaseLog { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [int] + ${LogEntryTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPSecureStoreCredentialMapping { + [CmdletBinding(DefaultParameterSetName='OneApplication', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='AllApplications', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ParameterSetName='OneApplication', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(ParameterSetName='AllApplications', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPSecureStoreDefaultProvider { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPServerScaleOutDatabaseDeletedDataSubRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPServerScaleOutDatabaseLog { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [int] + ${LogEntryTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Connect-SPConfigurationDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(Mandatory=$true, Position=8, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [securestring] + ${Passphrase}, + + [Parameter(Position=9, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SkipRegisterAsDistributedCacheHost}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Convert-SPWebApplication { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateSet('LEGACY','CLAIMS-WINDOWS','CLAIMS-TRUSTED-DEFAULT')] + [string] + ${From}, + + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateSet('CLAIMS','CLAIMS-WINDOWS','CLAIMS-TRUSTED-DEFAULT','CLAIMS-SHAREPOINT-ONLINE')] + [string] + ${To}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${Force}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${RetainPermissions}, + + [Parameter(ParameterSetName='Claims')] + [string] + ${SourceSkipList}, + + [Parameter(ParameterSetName='Claims')] + [string] + ${MapList}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${SkipSites}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${SkipPolicies}, + + [Parameter(ParameterSetName='Claims')] + [object] + ${Database}, + + [Parameter(ParameterSetName='Claims')] + [object] + ${TrustedProvider}, + + [Parameter(ParameterSetName='Claims')] + [guid] + ${SiteSubsriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPAccessServicesDatabaseCredentials { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AppUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [string] + ${SourceServer}, + + [Parameter(Mandatory=$true)] + [string] + ${TargetServer}, + + [Parameter(Mandatory=$true)] + [System.Net.NetworkCredential] + ${ServerCredential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPActivitiesToWorkflowService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${WorkflowServiceAddress}, + + [string] + ${ActivityName}, + + [System.Net.ICredentials] + ${Credential}, + + [bool] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPBusinessDataCatalogAclToChildren { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${MetadataObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPSite { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [object] + ${DestinationDatabase}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [string] + ${TargetUrl}, + + [string] + ${HostHeaderWebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPAppAutoProvision { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPBusinessDataCatalogEntity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPFeature { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Url}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPHealthAnalysisRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Url')] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPSessionStateService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPSingleSignOn { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPUserLicensing { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPWebApplicationHttpThrottling { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disconnect-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Dismount-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Dismount-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPAppAutoProvision { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPBusinessDataCatalogEntity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPFeature { + [CmdletBinding(DefaultParameterSetName='FarmFeatureDefinition', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteFeature')] + [string] + ${Url}, + + [switch] + ${PassThru}, + + [switch] + ${Force}, + + [Parameter(ParameterSetName='FarmFeatureDefinition')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPHealthAnalysisRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('url')] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPSessionStateService { + [CmdletBinding(DefaultParameterSetName='AdvancedProvision', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultProvision', Mandatory=$true)] + [switch] + ${DefaultProvision}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='AdvancedProvision', Mandatory=$true)] + [string] + ${DatabaseName}, + + [System.Nullable[int]] + ${SessionTimeout}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPUserLicensing { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPWebApplicationHttpThrottling { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPAppPackage { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPBusinessDataCatalogModel { + [CmdletBinding()] +param( + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [string] + ${SettingId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPInfoPathAdministrationFiles { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPMetadataWebServicePartitionData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [switch] + ${NoCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPPerformancePointContent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${ExportFileUrl}, + + [Parameter(Mandatory=$true)] + [array] + ${ItemUrls}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPSiteSubscriptionSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${AdminProperties}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${IncludeVersions}, + + [int] + ${CompressionSize}, + + [switch] + ${UseSqlSnapshot}, + + [string] + ${AppLogFilePath}, + + [string] + ${ItemUrl}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${IncludeUserSecurity}, + + [switch] + ${HaltOnWarning}, + + [switch] + ${HaltOnError}, + + [switch] + ${NoLogFile}, + + [switch] + ${NoFileCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-AvailabilityGroupStatus { + [CmdletBinding()] +param( + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabase { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${ContentDb}, + + [Parameter(Position=2, ValueFromPipeline=$true)] + [bool] + ${AccessAppsOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabaseServer { + [CmdletBinding(DefaultParameterSetName='GetDatabaseServersParameterSet')] +param( + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='GetDatabaseServersParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='GetDatabaseServersParameterSet')] + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true)] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true)] + [object] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabaseServerGroup { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${DatabaseServerGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabaseServerGroupMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAlternateURL { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [object] + ${Zone}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${ResourceName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppAcquisitionConfiguration { + [CmdletBinding(DefaultParameterSetName='MarketplaceSettingsInWebApplication')] +param( + [Parameter(ParameterSetName='MarketplaceSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='MarketplaceSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppAutoProvisionConnection { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [object] + ${ConnectionType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppDeniedEndpointList { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppDisablingConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppDomain { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppHostingQuotaConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppInstance { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='IdentityParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(ParameterSetName='WebParameterSet')] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(ParameterSetName='SiteAndIdParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ParameterSetName='SiteAndIdParameterSet', Mandatory=$true)] + [guid] + ${AppInstanceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppPrincipal { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NameIdentifier}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppScaleProfile { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppSiteSubscriptionName { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStateSyncLastRunTime { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStateUpdateInterval { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStoreConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAuthenticationProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, Position=2)] + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAuthenticationRealm { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBackupHistory { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${Directory}, + + [switch] + ${ShowBackup}, + + [switch] + ${ShowRestore}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBingMapsBlock { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBingMapsKey { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBrowserCustomerExperienceImprovementProgram { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='Farm', Mandatory=$true)] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBusinessDataCatalogMetadataObject { + [CmdletBinding()] +param( + [string] + ${Namespace}, + + [string] + ${Name}, + + [string] + ${ContainingLobSystem}, + + [Parameter(Mandatory=$true)] + [object] + ${BdcObjectType}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBusinessDataCatalogThrottleConfig { + [CmdletBinding(DefaultParameterSetName='ProxyProvided')] +param( + [Parameter(Mandatory=$true)] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [object] + ${ThrottleType}, + + [Parameter(ParameterSetName='ProxyProvided', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ParameterSetName='FileBackedProvided', Mandatory=$true)] + [switch] + ${FileBacked}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPCertificateAuthority { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPClaimProviderManager { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPClaimTypeEncoding { + [CmdletBinding()] +param( + [char] + ${EncodingCharacter}, + + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet')] +param( + [Parameter(ParameterSetName='DefaultSet', Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='AllContentDatabasesInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDatabasesOfSite', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [switch] + ${ConnectAsUnattachedDatabase}, + + [Parameter(ParameterSetName='Unattached')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPContentDeploymentJob { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [object] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPContentDeploymentPath { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPCustomLayoutsPage { + [CmdletBinding()] +param( + [object] + ${Identity}, + + [ValidateRange(14, 15)] + [int] + ${CompatibilityLevel}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultParameterSet')] +param( + [Parameter(ParameterSetName='DefaultParameterSet', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServerParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServerInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDataConnectionFile { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDataConnectionFileDependent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='AllDeletedSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AllDeletedSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [string] + ${DateTimeFrom}, + + [string] + ${DateTimeTo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDesignerSettings { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDiagnosticConfig { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDiagnosticsPerformanceCounter { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ValueFromPipeline=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDiagnosticsProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDistributedCacheClientSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEduServiceSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [object] + ${Service}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchAdministrationComponent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchComponent { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [string] + ${Protocol}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlExtension { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlMapping { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlRule { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchFileFormat { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchHostController { + [CmdletBinding()] +param( + [object] + ${SearchServiceInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [object] + ${Type}, + + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchLinguisticComponentsStatus { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchLinksDatabase { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataCategory { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('p')] + [System.Nullable[guid]] + ${PropSet}, + + [Alias('vt')] + [Obsolete()] + [System.Nullable[int]] + ${VariantType}, + + [Alias('c')] + [object] + ${Category}, + + [string] + ${Limit}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [string] + ${Limit}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataMapping { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [object] + ${ManagedProperty}, + + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchOwner { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [Alias('l')] + [object] + ${Level}, + + [object] + ${SPWeb}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchPropertyRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${PropertyName}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Operator}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchPropertyRuleCollection { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAndSiteSettingsService { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAndSiteSettingsServiceProxy { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAuthority { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryDemoted { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryKeyword { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryScope { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('u')] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [uri] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Alias('n')] + [object] + ${Scope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQuerySpellingCorrection { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQuerySuggestionCandidates { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchRankingModel { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchResultItemType { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchResultSource { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchService { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceApplicationBackupStore { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${BackupFolder}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${Name}, + + [Parameter(Position=3, ValueFromPipeline=$true)] + [string] + ${BackupId}, + + [Parameter(Position=4)] + [switch] + ${UseMostRecent}, + + [Parameter(Position=5)] + [switch] + ${IsVerbose}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceInstance { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchSiteHitRule { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchStatus { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [switch] + ${Primary}, + + [switch] + ${Text}, + + [switch] + ${Detailed}, + + [switch] + ${Constellation}, + + [switch] + ${JobStatus}, + + [switch] + ${HealthReport}, + + [switch] + ${DetailSearchRuntime}, + + [string] + ${Component}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchTopology { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [switch] + ${Active}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchVssDataPath { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelBIServer { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelBlockedFileType { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelDataConnectionLibrary { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelFileLocation { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPExcelUserDefinedFunction { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPFarm { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPFarmConfig { + [CmdletBinding()] +param( + [switch] + ${ServiceConnectionPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPFeature { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='FarmFeatures')] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='SiteFeatures')] + [object] + ${Site}, + + [Parameter(ParameterSetName='WebFeatures')] + [object] + ${Web}, + + [Parameter(ParameterSetName='WebApplicationFeatures')] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteFeatures')] + [switch] + ${Sandboxed}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='FarmFeatureDefinitions')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPHealthAnalysisRule { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(ParameterSetName='SpecificRule', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPHelpCollection { + [CmdletBinding()] +param( + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathFormsService { + [CmdletBinding()] +param( + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathFormTemplate { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathUserAgent { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathWebServiceProxy { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInternalAppStateSyncLastRunTime { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInternalAppStateUpdateInterval { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPIRMSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPLogEvent { + [CmdletBinding(DefaultParameterSetName='Directory')] +param( + [Parameter(ParameterSetName='Directory')] + [ValidateNotNullOrEmpty()] + [string] + ${Directory}, + + [Parameter(ParameterSetName='File')] + [ValidateNotNullOrEmpty()] + [string] + ${File}, + + [switch] + ${AsString}, + + [ValidateNotNullOrEmpty()] + [string[]] + ${ContextKey}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [ValidateNotNullOrEmpty()] + [string] + ${MinimumLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPLogLevel { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Service')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Service', ValueFromPipeline=$true)] + [object] + ${Service}, + + [Parameter(ParameterSetName='WebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='Server', ValueFromPipeline=$true)] + [object] + ${Server}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication')] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMetadataServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMetadataServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMobileMessagingAccount { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [Alias('ServiceType','AccountType')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPODataConnectionSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [ValidateNotNull()] + [ValidateLength(0, 246)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPODataConnectionSettingMetadata { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 255)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPOfficeStoreAppsDefaultActivation { + [CmdletBinding(DefaultParameterSetName='AppsForOfficeSettingsInWebApplication')] +param( + [Parameter(ParameterSetName='AppsForOfficeSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPendingUpgradeActions { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RootObject}, + + [switch] + ${Recursive}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPluggableSecurityTrimmer { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProcessAccount { + [CmdletBinding(DefaultParameterSetName='NetworkService')] +param( + [Parameter(ParameterSetName='NetworkService')] + [switch] + ${NetworkService}, + + [Parameter(ParameterSetName='LocalSystem')] + [switch] + ${LocalSystem}, + + [Parameter(ParameterSetName='LocalService')] + [switch] + ${LocalService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProduct { + [CmdletBinding(DefaultParameterSetName='Local')] +param( + [Parameter(ParameterSetName='Server', ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Server}, + + [Parameter(ParameterSetName='Local')] + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProfileLeader { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProfileServiceApplicationSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [ValidateSet('UserACL','MySiteReaderACL')] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRequestManagementSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Availability}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabaseDataState { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabaseInconsistency { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabaseLogEntry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [int] + ${Count}, + + [object] + ${MajorAction}, + + [System.Nullable[guid]] + ${CorrelationId}, + + [byte[]] + ${RangeLimitPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSecureStoreApplication { + [CmdletBinding(DefaultParameterSetName='NameSet')] +param( + [Parameter(ParameterSetName='AllSet', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ParameterSetName='NameSet', Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSecureStoreSystemAccount { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSecurityTokenServiceConfig { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabaseDataState { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabaseInconsistency { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabaseLogEntry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [int] + ${Count}, + + [object] + ${MajorAction}, + + [System.Nullable[guid]] + ${CorrelationId}, + + [byte[]] + ${RangeLimitPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationEndpoint { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Name', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Name')] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationPool { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationProxyGroup { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default identity', Mandatory=$true)] + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Admin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceContext { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='Site', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceHostConfig { + [CmdletBinding()] +param( + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceInstance { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Server', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Server}, + + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSessionStateService { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPShellAdmin { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSite { + [CmdletBinding(DefaultParameterSetName='AllSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AllSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='AllSitesInContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='AllSitesInWebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AllSitesInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='AllSitesInIdentity')] + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteAdministration { + [CmdletBinding(DefaultParameterSetName='AllSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AllSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='AllSitesInContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='AllSitesInWebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AllSitesInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='AllSitesInIdentity')] + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscription { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionConfig { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionEdiscoveryHub { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionEdiscoverySearchScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionFeaturePack { + [CmdletBinding(DefaultParameterSetName='FeaturePack')] +param( + [Parameter(ParameterSetName='FeaturePack', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteSubscription', ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionIRMConfig { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionMetadataConfig { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteUpgradeSessionInfo { + [CmdletBinding(DefaultParameterSetName='ContentDB')] +param( + [Parameter(ParameterSetName='Site', Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ParameterSetName='ContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='ContentDB')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${HideWaiting}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowInProgress}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowCompleted}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowFailed}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSolution { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPStateServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPStateServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPStateServiceDatabase { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Default', Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServiceApplication', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Application')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTaxonomySession { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTimerJob { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTopologyServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTopologyServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTranslationThrottlingSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [object] + ${Farm}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedIdentityTokenIssuer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedRootAuthority { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedSecurityTokenIssuer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedServiceTokenIssuer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUpgradeActions { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUsageApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUsageDefinition { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUsageService { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUser { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [object] + ${Group}, + + [string] + ${Limit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserLicense { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserLicenseMapping { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserLicensing { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserSettingsProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserSettingsProviderManager { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserSolution { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioExternalData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioPerformance { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [string] + ${DataProviderId}, + + [int] + ${DataProviderType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Site}, + + [string] + ${Limit}, + + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeCentralAdministration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebApplicationAppDomain { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${AppDomain}, + + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebApplicationHttpThrottlingMonitor { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebPartPack { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [switch] + ${GlobalOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebTemplate { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [uint32] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWOPIBinding { + [CmdletBinding()] +param( + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Server}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WOPIZone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWOPISuppressionSetting { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWOPIZone { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWorkflowConfig { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWorkflowServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Grant-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Right}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Grant-SPObjectSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNull()] + [string[]] + ${Rights}, + + [switch] + ${Replace}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPAppPackage { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [object] + ${Source}, + + [string] + ${AssetId}, + + [string] + ${ContentMarket}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPBusinessDataCatalogDotNetAssembly { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [ValidateNotNullOrEmpty()] + [string[]] + ${DependentAssemblyPaths}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${LobSystem}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPBusinessDataCatalogModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ParameterSetName='Catalog', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${Force}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchCustomExtractionDictionary { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the UNC path to the CSV file.')] + [string] + ${FileName}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the fully qualified name of the target dictionary to be deployed.')] + [ValidateSet('Microsoft.UserDictionaries.EntityExtraction.Custom.Word.1','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.2','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.3','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.4','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.5','Microsoft.UserDictionaries.EntityExtraction.Custom.ExactWord.1','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.1','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.2','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.3','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.4','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.5','Microsoft.UserDictionaries.EntityExtraction.Custom.ExactWordPart.1')] + [string] + ${DictionaryName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchPopularQueries { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [object] + ${ResultSource}, + + [Parameter(Mandatory=$true)] + [object] + ${Web}, + + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchThesaurus { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the UNC path to the CSV file.')] + [string] + ${FileName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPInfoPathAdministrationFiles { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPMetadataWebServicePartitionData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [switch] + ${NoCompression}, + + [ValidateSet('true','false')] + [switch] + ${OverwriteExisting}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPPerformancePointContent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${ImportFileUrl}, + + [Parameter(Mandatory=$true)] + [string] + ${MasterPageUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteDestination}, + + [Parameter(Mandatory=$true)] + [hashtable] + ${LocationMap}, + + [Parameter(Mandatory=$true)] + [hashtable] + ${DatasourceMap}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPSiteSubscriptionSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${AdminProperties}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${IncludeUserCustomAction}, + + [switch] + ${ActivateSolutions}, + + [object] + ${UpdateVersions}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${IncludeUserSecurity}, + + [switch] + ${HaltOnWarning}, + + [switch] + ${HaltOnError}, + + [switch] + ${NoLogFile}, + + [switch] + ${NoFileCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Initialize-SPResourceSecurity { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Initialize-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPApp { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPApplicationContent { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebAccessible}, + + [switch] + ${Overwrite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPEduSites { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${MySiteHost}, + + [Parameter(Mandatory=$true, Position=2, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SearchCenter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPFeature { + [CmdletBinding(DefaultParameterSetName='PathSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='PathSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [Parameter(ParameterSetName='AllExistingFeatures', Mandatory=$true)] + [switch] + ${AllExistingFeatures}, + + [Parameter(ParameterSetName='ScanForFeatures', Mandatory=$true)] + [switch] + ${ScanForFeatures}, + + [switch] + ${Force}, + + [Parameter(ParameterSetName='ScanForFeatures')] + [Parameter(ParameterSetName='AllExistingFeatures')] + [string] + ${SolutionId}, + + [Parameter(ParameterSetName='PathSet')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPHelpCollection { + [CmdletBinding(DefaultParameterSetName='InstallOne')] +param( + [Parameter(ParameterSetName='InstallOne', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${LiteralPath}, + + [Parameter(ParameterSetName='InstallAll', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [switch] + ${EnableGradualUpgrade}, + + [switch] + ${NoWait}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPService { + [CmdletBinding()] +param( + [switch] + ${Provision}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPSolution { + [CmdletBinding(DefaultParameterSetName='Deploy', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Synchronize', Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Deploy', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Deploy')] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='Deploy')] + [string] + ${Time}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${CASPolicies}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${GACDeployment}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${FullTrustBinDeployment}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${Local}, + + [uint32] + ${Language}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${Force}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${AllWebApplications}, + + [Parameter(ParameterSetName='Deploy')] + [string] + ${CompatibilityLevel}, + + [Parameter(ParameterSetName='Synchronize', Mandatory=$true)] + [switch] + ${Synchronize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPWebPartPack { + [CmdletBinding(DefaultParameterSetName='UseFileName', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='UseName', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='UseFileName', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${LiteralPath}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [switch] + ${GlobalInstall}, + + [uint32] + ${Language}, + + [switch] + ${Force}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Merge-SPLogFile { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Overwrite}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [string[]] + ${Process}, + + [uint32[]] + ${ThreadID}, + + [string[]] + ${Area}, + + [string[]] + ${Category}, + + [string[]] + ${EventID}, + + [string] + ${Level}, + + [string[]] + ${Message}, + + [guid[]] + ${Correlation}, + + [string[]] + ${ContextFilter}, + + [switch] + ${ExcludeNestedCorrelation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Mount-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${SkipIntegrityChecks}, + + [switch] + ${NoB2BSiteUpgrade}, + + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${ClearChangeLog}, + + [switch] + ${ChangeSyncKnowledge}, + + [switch] + ${AssignNewDatabaseId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Mount-SPStateServiceDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Weight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPBlobStorageLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${SourceDatabase}, + + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDataSourceInstance}, + + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDatabase}, + + [ValidateNotNullOrEmpty()] + [string] + ${Dir}, + + [ValidateNotNullOrEmpty()] + [bool] + ${VerboseMod}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${DestinationDatabase}, + + [hashtable] + ${RbsProviderMapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPEnterpriseSearchLinksDatabases { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=1)] + [System.Nullable[guid]] + ${RepartitioningId}, + + [Parameter(Position=2)] + [object] + ${SourceStores}, + + [Parameter(Position=3)] + [object] + ${TargetStores}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPProfileManagedMetadataProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Identity}, + + [string] + ${TermSetName}, + + [switch] + ${AvailableForTagging}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${DestinationDatabase}, + + [hashtable] + ${RbsProviderMapping}, + + [bool] + ${CopyEvents}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPSocialComment { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [string] + ${OldUrl}, + + [string] + ${NewUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewAlias}, + + [switch] + ${IgnoreSID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [string] + ${Name}, + + [switch] + ${Default}, + + [ValidateRange(1, 255)] + [int] + ${ColumnsMax}, + + [ValidateRange(1, 200000)] + [int] + ${RowsMax}, + + [ValidateRange(1, 20)] + [int] + ${SourcesMax}, + + [ValidateRange(0, 32)] + [int] + ${OutputCalculatedColumnsMax}, + + [ValidateRange(0, 8)] + [int] + ${OrderByMax}, + + [switch] + ${OuterJoinsAllowed}, + + [switch] + ${NonRemotableQueriesAllowed}, + + [ValidateRange(-1, 2147483647)] + [int] + ${RecordsInTableMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${ApplicationLogSizeMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(0, 4096)] + [int] + ${SessionMemoryMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${TemplateSizeMax}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServicesApplication { + [CmdletBinding(DefaultParameterSetName='NoApplicationServerParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateNotNull()] + [pscredential] + ${DatabaseServerCredentials}, + + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='NoApplicationServerParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [string] + ${Name}, + + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [switch] + ${Default}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${QueryTimeout}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 1440)] + [int] + ${RecoveryPointObjective}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${Hosted}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${Encrypt}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${TrustServerCertificate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServicesApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${application}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServicesDatabaseServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServerGroupName}, + + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [ValidateNotNullOrEmpty()] + [pscredential] + ${DatabaseServerCredentials}, + + [ValidateNotNullOrEmpty()] + [bool] + ${AvailableForCreate}, + + [ValidateNotNullOrEmpty()] + [bool] + ${Exclusive}, + + [bool] + ${Encrypt}, + + [bool] + ${TrustServerCertificate}, + + [bool] + ${ValidateServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${SecondaryDatabaseServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${UserDomain}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAlternateURL { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [object] + ${Zone}, + + [switch] + ${Internal}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${ResourceName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAppManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAppManagementServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [switch] + ${UseDefaultProxyGroup}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Uri}, + + [Parameter(ParameterSetName='ServiceApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAuthenticationProvider { + [CmdletBinding(DefaultParameterSetName='Windows')] +param( + [Parameter(ParameterSetName='Windows')] + [switch] + ${AllowAnonymous}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${UseBasicAuthentication}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${DisableKerberos}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${UseWindowsIntegratedAuthentication}, + + [Parameter(ParameterSetName='Forms', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ASPNETMembershipProvider}, + + [Parameter(ParameterSetName='Forms', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ASPNETRoleProviderName}, + + [Parameter(ParameterSetName='Trusted', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAzureAccessControlServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${MetadataServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPBECWebServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPBusinessDataCatalogServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [switch] + ${Sharing}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPBusinessDataCatalogServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [switch] + ${DefaultProxyGroup}, + + [string] + ${Name}, + + [Parameter(ParameterSetName='PipeBind', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri')] + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPCentralAdministration { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [int] + ${Port}, + + [Parameter(Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${WindowsAuthProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${DisplayName}, + + [Parameter(Mandatory=$true)] + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [string] + ${AssemblyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Type}, + + [switch] + ${Enabled}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimsPrincipal { + [CmdletBinding(DefaultParameterSetName='IdentityType')] +param( + [Parameter(ParameterSetName='IdentityType', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='STSIdentity', Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ParameterSetName='IdentityType', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${IdentityType}, + + [Parameter(ParameterSetName='BasicClaim', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${EncodedClaim}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='STSIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimValue}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='STSIdentity', Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=2)] + [ValidateNotNull()] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='STSIdentity', Position=3)] + [ValidateNotNull()] + [switch] + ${IdentifierClaim}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimTypeEncoding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [char] + ${EncodingCharacter}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimTypeMapping { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${IncomingClaimType}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${IncomingClaimTypeDisplayName}, + + [Parameter(Position=2)] + [ValidateNotNullOrEmpty()] + [string] + ${LocalClaimType}, + + [ValidateNotNull()] + [switch] + ${SameAsIncoming}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPConfigurationDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(Position=2, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DirectoryDomain}, + + [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DirectoryOrganizationUnit}, + + [Parameter(Position=4, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${AdministrationContentDatabaseName}, + + [Parameter(Position=5, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(Mandatory=$true, Position=6, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${FarmCredentials}, + + [Parameter(Mandatory=$true, Position=7, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [securestring] + ${Passphrase}, + + [Parameter(Position=8, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SkipRegisterAsDistributedCacheHost}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${ClearChangeLog}, + + [switch] + ${ChangeSyncKnowledge}, + + [switch] + ${AssignNewDatabaseId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [object] + ${SPContentDeploymentPath}, + + [object] + ${Scope}, + + [string] + ${Schedule}, + + [switch] + ${ScheduleEnabled}, + + [switch] + ${IncrementalEnabled}, + + [object] + ${SqlSnapshotSetting}, + + [switch] + ${HostingSupportEnabled}, + + [object] + ${EmailNotifications}, + + [string[]] + ${EmailAddresses}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceSPWebApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceSPSite}, + + [Parameter(Mandatory=$true)] + [uri] + ${DestinationCentralAdministrationURL}, + + [Parameter(Mandatory=$true)] + [uri] + ${DestinationSPWebApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DestinationSPSite}, + + [object] + ${Authentication}, + + [Parameter(Mandatory=$true)] + [pscredential] + ${PathAccount}, + + [switch] + ${DeployUserNamesEnabled}, + + [object] + ${DeploySecurityInformation}, + + [switch] + ${EventReceiversEnabled}, + + [switch] + ${CompressionEnabled}, + + [switch] + ${PathEnabled}, + + [object] + ${KeepTemporaryFilesOptions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEduClass { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${ClassId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${ClassName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [System.Nullable[datetime]] + ${StartDate}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [System.Nullable[datetime]] + ${EndDate}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Year}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${DayOfWeek}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${StartTime}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${EndTime}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Building}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Room}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchAdminComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchAnalyticsProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchContentProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [object] + ${Type}, + + [string] + ${Tag}, + + [Alias('s')] + [string] + ${StartAddresses}, + + [Alias('p')] + [object] + ${CrawlPriority}, + + [System.Nullable[int]] + ${MaxPageEnumerationDepth}, + + [System.Nullable[int]] + ${MaxSiteEnumerationDepth}, + + [object] + ${SharePointCrawlBehavior}, + + [object] + ${BDCApplicationProxyGroup}, + + [string[]] + ${LOBSystemSet}, + + [string] + ${CustomProtocol}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Protocol}, + + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [string] + ${ModelFilePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [string] + ${Target}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Path}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [object] + ${Type}, + + [System.Nullable[bool]] + ${IsAdvancedRegularExpression}, + + [System.Nullable[bool]] + ${CrawlAsHttp}, + + [System.Nullable[bool]] + ${FollowComplexUrls}, + + [System.Nullable[int]] + ${PluggableSecurityTimmerId}, + + [System.Nullable[bool]] + ${SuppressIndexing}, + + [System.Nullable[int]] + ${Priority}, + + [string] + ${ContentClass}, + + [object] + ${AuthenticationType}, + + [string] + ${AccountName}, + + [securestring] + ${AccountPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchFileFormat { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0)] + [string] + ${FormatId}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${FormatName}, + + [Parameter(Mandatory=$true, Position=2)] + [string] + ${MimeType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchIndexComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [uint32] + ${IndexPartition}, + + [string] + ${RootDirectory}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(Mandatory=$true)] + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('p')] + [System.Nullable[guid]] + ${PropSet}, + + [Alias('d')] + [System.Nullable[bool]] + ${DiscoverNewProperties}, + + [Alias('m')] + [System.Nullable[bool]] + ${MapToContents}, + + [Alias('auto')] + [System.Nullable[bool]] + ${AutoCreateNewManagedProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('c')] + [object] + ${Category}, + + [Parameter(Mandatory=$true)] + [Alias('ie')] + [bool] + ${IsNameEnum}, + + [Parameter(Mandatory=$true)] + [Alias('vt')] + [Obsolete()] + [int] + ${VariantType}, + + [Parameter(Mandatory=$true)] + [Alias('p')] + [guid] + ${PropSet}, + + [Alias('im')] + [System.Nullable[bool]] + ${IsMappedToContents}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [int] + ${Type}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('f')] + [System.Nullable[bool]] + ${FullTextQueriable}, + + [Alias('r')] + [System.Nullable[bool]] + ${Retrievable}, + + [Alias('q')] + [System.Nullable[bool]] + ${Queryable}, + + [Alias('e')] + [System.Nullable[bool]] + ${EnabledForScoping}, + + [Alias('nn')] + [System.Nullable[bool]] + ${NameNormalized}, + + [Alias('rp')] + [System.Nullable[bool]] + ${RespectPriority}, + + [Alias('rd')] + [System.Nullable[bool]] + ${RemoveDuplicates}, + + [Alias('im5')] + [Obsolete('This property is replaced by IncludeInAlertSignature.')] + [System.Nullable[bool]] + ${IncludeInMd5}, + + [Alias('sfa')] + [System.Nullable[bool]] + ${SafeForAnonymous}, + + [Alias('ia')] + [System.Nullable[bool]] + ${IncludeInAlertSignature}, + + [Alias('nw')] + [System.Nullable[bool]] + ${NoWordBreaker}, + + [Alias('u')] + [System.Nullable[int16]] + ${UserFlags}, + + [Alias('qir')] + [System.Nullable[bool]] + ${EnabledForQueryIndependentRank}, + + [Alias('def')] + [System.Nullable[uint32]] + ${DefaultForQueryIndependentRank}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${ManagedProperty}, + + [Parameter(Mandatory=$true)] + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('l')] + [float] + ${Level}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryDemoted { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Term}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Alias('d')] + [string] + ${Definition}, + + [Alias('c')] + [string] + ${Contact}, + + [Alias('s')] + [System.Nullable[datetime]] + ${StartDate}, + + [Alias('e')] + [System.Nullable[datetime]] + ${EndDate}, + + [Alias('r')] + [System.Nullable[datetime]] + ${ReviewDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('d')] + [string] + ${Description}, + + [Alias('o')] + [uri] + ${OwningSiteUrl}, + + [Alias('a')] + [string] + ${AlternateResultsPage}, + + [Parameter(Mandatory=$true)] + [Alias('disp')] + [System.Nullable[bool]] + ${DisplayInAdminUI}, + + [Alias('type')] + [System.Nullable[int]] + ${CompilationType}, + + [Alias('f')] + [string] + ${ExtendedSearchFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Alias('s')] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [Alias('type')] + [string] + ${RuleType}, + + [Alias('f')] + [string] + ${FilterBehavior}, + + [Alias('ut')] + [string] + ${UrlScopeRuleType}, + + [Alias('text')] + [string] + ${MatchingString}, + + [Alias('value')] + [string] + ${PropertyValue}, + + [Alias('mname')] + [object] + ${ManagedProperty}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${RankingModelXML}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchResultItemType { + [CmdletBinding(DefaultParameterSetName='New', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(ParameterSetName='New', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='Copy', Position=1)] + [Alias('n')] + [string] + ${Name}, + + [Parameter(ParameterSetName='Copy', Position=2)] + [Parameter(ParameterSetName='New', Mandatory=$true, Position=2)] + [Alias('rule')] + [object] + ${Rules}, + + [Parameter(Position=3)] + [Alias('priority')] + [int] + ${RulePriority}, + + [Parameter(Position=4)] + [Alias('dp')] + [string] + ${DisplayProperties}, + + [Parameter(Position=5)] + [Alias('sid')] + [System.Nullable[guid]] + ${SourceID}, + + [Parameter(ParameterSetName='Copy', Position=6)] + [Parameter(ParameterSetName='New', Mandatory=$true, Position=6)] + [Alias('url')] + [string] + ${DisplayTemplateUrl}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ParameterSetName='Copy', Mandatory=$true)] + [Alias('copy')] + [object] + ${ExistingResultItemType}, + + [Parameter(ParameterSetName='Copy', Mandatory=$true)] + [Alias('eo')] + [object] + ${ExistingResultItemTypeOwner}, + + [Alias('opt')] + [System.Nullable[bool]] + ${OptimizeForFrequentUse}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [string] + ${QueryTemplate}, + + [Parameter(Mandatory=$true)] + [guid] + ${ProviderId}, + + [string] + ${RemoteUrl}, + + [System.Nullable[bool]] + ${AutoDiscover}, + + [object] + ${AuthenticationType}, + + [string] + ${UserName}, + + [string] + ${Password}, + + [string] + ${SsoId}, + + [System.Nullable[bool]] + ${MakeDefault}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [int] + ${Id}, + + [Parameter(Mandatory=$true)] + [string] + ${TypeName}, + + [string] + ${Properties}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [string] + ${RulePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [switch] + ${Partitioned}, + + [Parameter(Mandatory=$true)] + [object] + ${ApplicationPool}, + + [object] + ${AdminApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='SSA', Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [string] + ${Uri}, + + [switch] + ${Partitioned}, + + [switch] + ${MergeWithDefaultPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchSiteHitRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchService}, + + [Parameter(Mandatory=$true)] + [string] + ${HitRate}, + + [Parameter(Mandatory=$true)] + [string] + ${Behavior}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='Clone')] + [switch] + ${Clone}, + + [Parameter(ParameterSetName='Clone')] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelBIServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${ServerId}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelBlockedFileType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${FileType}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelDataConnectionLibrary { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Address}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelDataProvider { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${ProviderId}, + + [Parameter(Mandatory=$true)] + [object] + ${ProviderType}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelFileLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Address}, + + [object] + ${LocationType}, + + [switch] + ${IncludeChildren}, + + [int] + ${SessionTimeout}, + + [int] + ${ShortSessionTimeout}, + + [int] + ${NewWorkbookSessionTimeout}, + + [int] + ${RequestDurationMax}, + + [int] + ${ChartRenderDurationMax}, + + [int] + ${WorkbookSizeMax}, + + [int] + ${ChartAndImageSizeMax}, + + [int] + ${AutomaticVolatileFunctionCacheLifetime}, + + [object] + ${DefaultWorkbookCalcMode}, + + [object] + ${ExternalDataAllowed}, + + [switch] + ${WarnOnDataRefresh}, + + [switch] + ${DisplayGranularExtDataErrors}, + + [switch] + ${AbortOnRefreshOnOpenFail}, + + [int] + ${PeriodicExtDataCacheLifetime}, + + [int] + ${ManualExtDataCacheLifetime}, + + [int] + ${ConcurrentDataRequestsPerSessionMax}, + + [switch] + ${UdfsAllowed}, + + [string] + ${Description}, + + [switch] + ${RESTExternalDataAllowed}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelServiceApplication { + [CmdletBinding(DefaultParameterSetName='ExistingTargetApplicationParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [int] + ${ExternalDataConnectionLifetime}, + + [Parameter(ParameterSetName='ExistingTargetApplicationParameterSet')] + [string] + ${UnattendedAccountApplicationId}, + + [object] + ${LoadBalancingScheme}, + + [int] + ${SessionsPerUserMax}, + + [int] + ${PrivateBytesMax}, + + [int] + ${MemoryCacheThreshold}, + + [int] + ${UnusedObjectAgeMax}, + + [int] + ${ThrottleAccessViolationsPerSiteCollection}, + + [int] + ${SiteCollectionAnonymousSessionsMax}, + + [string] + ${WorkbookCache}, + + [int] + ${WorkbookCacheSizeMax}, + + [switch] + ${CachingOfUnusedFilesEnable}, + + [object] + ${FileAccessMethod}, + + [object] + ${EncryptedUserConnectionRequired}, + + [switch] + ${CrossDomainAccessAllowed}, + + [switch] + ${TerminateProcessOnAccessViolation}, + + [switch] + ${UseEffectiveUserName}, + + [string] + ${WorkbookModelUsageTracker}, + + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${Default}, + + [Parameter(ParameterSetName='NewTargetApplicationParameterSet')] + [pscredential] + ${UnattendedServiceAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPExcelUserDefinedFunction { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Assembly}, + + [object] + ${AssemblyLocation}, + + [switch] + ${Enable}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPLogFile { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPManagedAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [pscredential] + ${Credential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${RelativeURL}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [switch] + ${Explicit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPMarketplaceWebServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPMetadataServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${AdministratorAccount}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${FullAccessAccount}, + + [string] + ${HubUri}, + + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='NoQuota', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='Quota', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [string] + ${ReadAccessAccount}, + + [string] + ${RestrictedAccount}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [int] + ${CacheTimeCheckInterval}, + + [int] + ${MaxChannelCache}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true)] + [switch] + ${DisablePartitionQuota}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${GroupsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermSetsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${LabelsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${PropertiesPerPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPMetadataServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${ContentTypePushdownEnabled}, + + [switch] + ${ContentTypeSyndicationEnabled}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${DefaultKeywordTaxonomy}, + + [switch] + ${DefaultSiteCollectionTaxonomy}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [object] + ${ServiceApplication}, + + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPODataConnectionSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateLength(0, 246)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${ServiceAddressURL}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [string] + ${ExtensionProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPOnlineApplicationPrincipalManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${OnlineTenantUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateLength(0, 64)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [bool] + ${CommentsDisabled}, + + [int] + ${CommentsScorecardMax}, + + [int] + ${IndicatorImageCacheSeconds}, + + [int] + ${DataSourceQueryTimeoutSeconds}, + + [int] + ${FilterRememberUserSelectionsDays}, + + [int] + ${FilterTreeMembersMax}, + + [int] + ${FilterSearchResultsMax}, + + [int] + ${ShowDetailsInitialRows}, + + [bool] + ${ShowDetailsMaxRowsDisabled}, + + [int] + ${ShowDetailsMaxRows}, + + [bool] + ${MSMQEnabled}, + + [string] + ${MSMQName}, + + [int] + ${SessionHistoryHours}, + + [bool] + ${AnalyticQueryLoggingEnabled}, + + [bool] + ${TrustedDataSourceLocationsRestricted}, + + [bool] + ${TrustedContentLocationsRestricted}, + + [int] + ${SelectMeasureMaximum}, + + [int] + ${DecompositionTreeMaximum}, + + [bool] + ${ApplicationProxyCacheEnabled}, + + [bool] + ${ApplicationCacheEnabled}, + + [int] + ${ApplicationCacheMinimumHitCount}, + + [int] + ${AnalyticResultCacheMinimumHitCount}, + + [int] + ${ElementCacheSeconds}, + + [int] + ${AnalyticQueryCellMax}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseFailoverServer}, + + [pscredential] + ${DatabaseSQLAuthenticationCredential}, + + [bool] + ${UseEffectiveUserName}, + + [string] + ${DataSourceUnattendedServiceAccountTargetApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPerformancePointServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateLength(0, 64)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateLength(0, 1024)] + [string] + ${Url}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(Mandatory=$true)] + [object] + ${TrustedLocationType}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPowerPointConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 128)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPowerPointConversionServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 128)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${AddToDefaultGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [string] + ${ProfileDBName}, + + [string] + ${ProfileDBServer}, + + [pscredential] + ${ProfileDBCredentials}, + + [string] + ${ProfileDBFailoverServer}, + + [string] + ${SocialDBName}, + + [string] + ${SocialDBServer}, + + [pscredential] + ${SocialDBCredentials}, + + [string] + ${SocialDBFailoverServer}, + + [string] + ${ProfileSyncDBName}, + + [string] + ${ProfileSyncDBServer}, + + [pscredential] + ${ProfileSyncDBCredentials}, + + [string] + ${ProfileSyncDBFailoverServer}, + + [switch] + ${PartitionMode}, + + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPProfileServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [string] + ${Name}, + + [Parameter(ParameterSetName='Application', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPRequestManagementRuleCriteria { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='StandardParameterSet', Mandatory=$true, Position=0)] + [Parameter(ParameterSetName='CustomPropertyParameterSet', Mandatory=$true, Position=0)] + [string] + ${Value}, + + [Parameter(ParameterSetName='CustomPropertyParameterSet', Mandatory=$true, Position=1)] + [string] + ${CustomHeader}, + + [Parameter(ParameterSetName='StandardParameterSet', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Property}, + + [Parameter(ParameterSetName='StandardParameterSet', Position=2)] + [Parameter(ParameterSetName='CustomPropertyParameterSet', Position=2)] + [ValidateNotNull()] + [object] + ${MatchType}, + + [Parameter(ParameterSetName='CustomPropertyParameterSet', Position=2)] + [Parameter(ParameterSetName='StandardParameterSet', Position=2)] + [System.Nullable[switch]] + ${CaseSensitive}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreApplication { + [CmdletBinding()] +param( + [object] + ${Administrator}, + + [object] + ${CredentialsOwnerGroup}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Fields}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [object] + ${TargetApplication}, + + [object] + ${TicketRedeemer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreApplicationField { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [switch] + ${Masked}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(Mandatory=$true)] + [switch] + ${AuditingEnabled}, + + [System.Nullable[int]] + ${AuditlogMaxSize}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseName}, + + [securestring] + ${DatabasePassword}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [switch] + ${Sharing}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${DefaultProxyGroup}, + + [string] + ${Name}, + + [Parameter(ParameterSetName='PipeBind', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreTargetApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${ApplicationType}, + + [string] + ${ContactEmail}, + + [Parameter(Mandatory=$true)] + [string] + ${FriendlyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${SetCredentialsUri}, + + [int] + ${TimeoutInMinutes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 100)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Account}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPServiceApplicationProxyGroup { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(0, 100)] + [AllowEmptyString()] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [uint32] + ${Language}, + + [object] + ${Template}, + + [string] + ${Name}, + + [string] + ${Description}, + + [object] + ${QuotaTemplate}, + + [string] + ${OwnerEmail}, + + [Parameter(Mandatory=$true)] + [object] + ${OwnerAlias}, + + [string] + ${SecondaryEmail}, + + [object] + ${SecondaryOwnerAlias}, + + [object] + ${HostHeaderWebApplication}, + + [object] + ${ContentDatabase}, + + [object] + ${SiteSubscription}, + + [object] + ${AdministrationSiteType}, + + [int] + ${CompatibilityLevel}, + + [switch] + ${OverrideCompatibilityRestriction}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSiteSubscription { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSiteSubscriptionFeaturePack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPStateServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPStateServiceApplicationProxy { + [CmdletBinding()] +param( + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPStateServiceDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Weight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSubscriptionSettingsServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSubscriptionSettingsServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Uri}, + + [Parameter(ParameterSetName='ServiceApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTranslationServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${PartitionMode}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTranslationServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [Parameter(ParameterSetName='ConnectLocal', Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='ConnectRemote', Mandatory=$true)] + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportTrustCertificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ClaimsMappings}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SignInUrl}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${IdentifierClaim}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Realm}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [switch] + ${UseWReply}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [switch] + ${UseDefaultConfiguration}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [ValidateSet('EMAIL','USER-PRINCIPAL-NAME','ACCOUNT-NAME')] + [string] + ${IdentifierClaimIs}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${SignOutUrl}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${RegisteredIssuerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='ManualUpdateCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [ValidateNotNullOrEmpty()] + [string] + ${RegisteredIssuerName}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IsTrustBroker}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 135)] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 135)] + [string] + ${FailoverDatabaseServer}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='SQLAuthentication')] + [ValidateLength(1, 128)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='SQLAuthentication')] + [ValidateNotNull()] + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUsageLogFile { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${UserAlias}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [string] + ${Email}, + + [object] + ${Group}, + + [string[]] + ${PermissionLevel}, + + [string] + ${DisplayName}, + + [switch] + ${SiteCollectionAdmin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUserLicenseMapping { + [CmdletBinding(DefaultParameterSetName='WindowsAuth', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='WindowsAuth', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SecurityGroup}, + + [Parameter(ParameterSetName='FormsAuth', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Role}, + + [Parameter(ParameterSetName='FormsAuth', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${RoleProviderName}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${OriginalIssuer}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Value}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ParameterSetName='ClaimsValues')] + [ValidateNotNullOrEmpty()] + [string] + ${ValueType}, + + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Claim}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${License}, + + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUserSettingsProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${DisplayName}, + + [Parameter(Mandatory=$true)] + [string] + ${AssemblyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${DataProviderType}, + + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPVisioServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${AddToDefaultGroup}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPVisioServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [uint32] + ${Language}, + + [object] + ${Template}, + + [string] + ${Name}, + + [string] + ${Description}, + + [switch] + ${AddToQuickLaunch}, + + [switch] + ${UniquePermissions}, + + [switch] + ${AddToTopNav}, + + [switch] + ${UseParentTopNav}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWebApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [string] + ${ApplicationPool}, + + [object] + ${ApplicationPoolAccount}, + + [Alias('ProxyGroup')] + [object] + ${ServiceApplicationProxyGroup}, + + [switch] + ${SecureSocketsLayer}, + + [string] + ${HostHeader}, + + [uint32] + ${Port}, + + [switch] + ${AllowAnonymousAccess}, + + [string] + ${Path}, + + [string] + ${Url}, + + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [object] + ${AuthenticationProvider}, + + [object] + ${AdditionalClaimProvider}, + + [string] + ${SignInRedirectURL}, + + [object] + ${SignInRedirectProvider}, + + [object] + ${UserSettingsProvider}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWebApplicationAppDomain { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${AppDomain}, + + [object] + ${Zone}, + + [int] + ${Port}, + + [switch] + ${SecureSocketsLayer}, + + [Parameter(Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWebApplicationExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [object] + ${Zone}, + + [uint32] + ${Port}, + + [string] + ${HostHeader}, + + [string] + ${Path}, + + [string] + ${Url}, + + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [switch] + ${AllowAnonymousAccess}, + + [switch] + ${SecureSocketsLayer}, + + [object] + ${AuthenticationProvider}, + + [object] + ${AdditionalClaimProvider}, + + [string] + ${SignInRedirectURL}, + + [object] + ${SignInRedirectProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [ValidateNotNullOrEmpty()] + [string] + ${FileName}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [switch] + ${AllowHTTP}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWOPISuppressionSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWordConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredential}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${PartitionMode}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWorkflowServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWorkManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${Proxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWorkManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [object] + ${ServiceApplication}, + + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Publish-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateLength(0, 250)] + [AllowEmptyString()] + [string] + ${Description}, + + [ValidateNotNullOrEmpty()] + [uri] + ${InfoLink}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Receive-SPServiceApplicationConnectionInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${FarmUrl}, + + [ValidateNotNullOrEmpty()] + [string] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Register-SPAppPrincipal { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NameIdentifier}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DisplayName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Register-SPWorkflowService { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SPSite}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WorkflowHostUri}, + + [string] + ${ScopeName}, + + [switch] + ${PartitionMode}, + + [switch] + ${AllowOAuthHttp}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-DatabaseFromAvailabilityGroup { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AGName}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='AllDatabases', Mandatory=$true)] + [switch] + ${ProcessAllDatabases}, + + [switch] + ${Force}, + + [switch] + ${KeepSecondaryData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAccessServicesDatabaseServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPActivityFeedItems { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [bool] + ${AllItems}, + + [long] + ${ID}, + + [string] + ${SearchText}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAlternateURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAppDeniedEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Endpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAppPrincipalPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${AppPrincipal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Scope}, + + [switch] + ${DisableAppOnlyPolicy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPBusinessDataCatalogModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPClaimTypeMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPDeletedSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPDiagnosticsPerformanceCounter { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ValueFromPipeline=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPDistributedCacheServiceInstance { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEduClassMember { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${UserAlias}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${ClassId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [string] + ${UserNames}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchFileFormat { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [object] + ${Type}, + + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryDemoted { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('u')] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Alias('n')] + [object] + ${Scope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchResultItemType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchServiceApplicationSiteSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${TenantId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchSiteHitRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchTenantConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Identity')] + [guid] + ${SiteSubscriptionId}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchTenantSchema { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPExcelBIServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPExcelBlockedFileType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPExcelDataConnectionLibrary { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPExcelDataProvider { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPExcelFileLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPExcelUserDefinedFunction { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPInfoPathUserAgent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ChangePassword')] + [switch] + ${ChangePassword}, + + [Parameter(ParameterSetName='ChangePassword', Mandatory=$true)] + [securestring] + ${NewPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPODataConnectionSetting { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPerformancePointServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPluggableSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(Mandatory=$true)] + [int] + ${PlugInId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPProfileLeader { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPProfileSyncConnection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionForestName}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionDomain}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionUserName}, + + [Parameter(Mandatory=$true)] + [securestring] + ${ConnectionPassword}, + + [string] + ${ConnectionServerName}, + + [string] + ${ConnectionNamingContext}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionSynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [switch] + ${DeleteData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSecureStoreApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSecureStoreSystemAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [switch] + ${DeleteData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationProxyGroup { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationProxyGroupMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [Alias('Proxy')] + [ValidateNotNull()] + [object] + ${Member}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPShellAdmin { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${UserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [switch] + ${DeleteADAccounts}, + + [switch] + ${GradualDelete}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscription { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionFeaturePack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionFeaturePackMember { + [CmdletBinding(DefaultParameterSetName='SingleFeatureDefinition', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SingleFeatureDefinition', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${FeatureDefinition}, + + [Parameter(ParameterSetName='AllFeatureDefinitions', Mandatory=$true)] + [switch] + ${AllFeatureDefinitions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionMetadataConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionSettings { + [CmdletBinding(DefaultParameterSetName='SpecifySiteSubscriptions', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SpecifySiteSubscriptions', Mandatory=$true)] + [ValidateNotNull()] + [guid[]] + ${SiteSubscriptions}, + + [Parameter(ParameterSetName='FindAllOrphans', Mandatory=$true)] + [ValidateSet('True')] + [switch] + ${FindAllOrphans}, + + [Parameter(ParameterSetName='FindAllOrphans')] + [ValidateNotNull()] + [guid[]] + ${AlternativeSiteSubscriptions}, + + [Parameter(ParameterSetName='FindAllOrphans')] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteUpgradeSessionInfo { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSocialItemByDate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [bool] + ${RemoveTags}, + + [bool] + ${RemoveComments}, + + [bool] + ${RemoveRatings}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [datetime] + ${EndDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [uint32] + ${Language}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSolutionDeploymentLock { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTranslationServiceJobHistory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeActiveJobs}, + + [System.Nullable[datetime]] + ${BeforeDate}, + + [System.Nullable[guid]] + ${JobId}, + + [System.Nullable[guid]] + ${PartitionId}, + + [switch] + ${AllPartitions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [object] + ${Group}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUserLicenseMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [System.Collections.Generic.List[guid]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUserSettingsProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${DataProviderType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Recycle}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWebApplication { + [CmdletBinding(DefaultParameterSetName='RemoveWebApp', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='RemoveZoneOfWebApp', Mandatory=$true)] + [object] + ${Zone}, + + [Parameter(ParameterSetName='RemoveWebApp')] + [switch] + ${RemoveContentDatabases}, + + [switch] + ${DeleteIISSite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWebApplicationAppDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Server}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${WOPIZone}, + + [Parameter(ParameterSetName='RemoveAll')] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWOPISuppressionSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ParameterSetName='Identity', ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWordConversionServiceJobHistory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeActiveJobs}, + + [System.Nullable[datetime]] + ${BeforeDate}, + + [System.Nullable[guid]] + ${JobId}, + + [System.Nullable[guid]] + ${SubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Rename-SPServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Repair-SPManagedAccountDeployment { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Repair-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [guid] + ${RuleId}, + + [switch] + ${RunAlways}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Request-SPUpgradeEvaluationSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${NoUpgrade}, + + [switch] + ${Email}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Reset-SPAccessServicesDatabasePassword { + [CmdletBinding(DefaultParameterSetName='ResetAllApps', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='ResetSingleApp', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(ParameterSetName='ResetAllApps', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ResetSingleApp', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restart-SPAppInstanceJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${AppInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='Config')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='Config')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='Config')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='Full', Mandatory=$true)] + [string] + ${TopologyFile}, + + [Parameter(Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [object] + ${AdminSearchServiceInstance}, + + [Parameter(ParameterSetName='Full')] + [switch] + ${KeepId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPEnterpriseSearchServiceApplicationIndex { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='RestoreProgress', Mandatory=$true, Position=1)] + [string] + ${Handle}, + + [Parameter(ParameterSetName='Restore', Mandatory=$true, Position=1)] + [string] + ${BackupFolder}, + + [Parameter(ParameterSetName='Restore', Position=2)] + [switch] + ${AllReplicas}, + + [Parameter(ParameterSetName='Restore', Position=3)] + [switch] + ${AllowMove}, + + [Parameter(Position=4)] + [int] + ${Retries}, + + [Parameter(Position=5)] + [int] + ${RetryPauseSeconds}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPFarm { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Directory}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [ValidateSet('New','Overwrite')] + [string] + ${RestoreMethod}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${RestoreThreads}, + + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [guid] + ${BackupId}, + + [Parameter(ParameterSetName='DefaultSet')] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='DefaultSet', ValueFromPipeline=$true)] + [pscredential] + ${FarmCredentials}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [switch] + ${ConfigurationOnly}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${Percentage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [string] + ${Path}, + + [string] + ${HostHeaderWebApplication}, + + [switch] + ${Force}, + + [switch] + ${GradualDelete}, + + [Parameter(ParameterSetName='DatabaseFromPipebind', ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='DatabaseParameter')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='DatabaseParameter')] + [string] + ${DatabaseServer}, + + [switch] + ${PreserveSiteID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Resume-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Resume-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Revoke-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Right}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Revoke-SPObjectSecurity { + [CmdletBinding(DefaultParameterSetName='RevokeOne')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='RevokeOne', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(ParameterSetName='RevokeOne', Position=2)] + [ValidateNotNull()] + [string[]] + ${Rights}, + + [Parameter(ParameterSetName='RevokeAll', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(1, 255)] + [int] + ${ColumnsMax}, + + [ValidateRange(1, 200000)] + [int] + ${RowsMax}, + + [ValidateRange(1, 20)] + [int] + ${SourcesMax}, + + [ValidateRange(0, 32)] + [int] + ${OutputCalculatedColumnsMax}, + + [ValidateRange(0, 8)] + [int] + ${OrderByMax}, + + [switch] + ${OuterJoinsAllowed}, + + [switch] + ${NonRemotableQueriesAllowed}, + + [ValidateRange(-1, 2147483647)] + [int] + ${RecordsInTableMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${ApplicationLogSizeMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(0, 4096)] + [int] + ${SessionMemoryMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${TemplateSizeMax}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServicesApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 1440)] + [int] + ${RecoveryPointObjective}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServicesDatabaseServer { + [CmdletBinding(DefaultParameterSetName='SetCredentialsParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [Parameter(Mandatory=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(Mandatory=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServer}, + + [Parameter(ParameterSetName='SetCredentialsParameterSet')] + [string] + ${DatabaseServerName}, + + [Parameter(ParameterSetName='SetCredentialsParameterSet')] + [pscredential] + ${DatabaseServerCredentials}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [bool] + ${AvailableForCreate}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet')] + [ValidateNotNullOrEmpty()] + [bool] + ${Exclusive}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [bool] + ${Encrypt}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [bool] + ${TrustServerCertificate}, + + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet')] + [string] + ${SecondaryDatabaseServerName}, + + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [bool] + ${Failover}, + + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UserDomain}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServicesDatabaseServerGroupMapping { + [CmdletBinding(DefaultParameterSetName='SetDatabaseServerGroupMappingParameter', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${CorporateCatalog}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [switch] + ${ObjectModel}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${RemoteObjectModel}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [switch] + ${DeveloperSite}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${StoreFront}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName', Mandatory=$true)] + [switch] + ${ClearMapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAlternateURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Url}, + + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppAcquisitionConfiguration { + [CmdletBinding(DefaultParameterSetName='MarketplaceSettingsInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ParameterSetName='MarketplaceSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='MarketplaceSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppAutoProvisionConnection { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='WebHostEndPoint', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [object] + ${ConnectionType}, + + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [string] + ${Username}, + + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [string] + ${Password}, + + [Parameter(ParameterSetName='WebHostEndPoint', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${EndPoint}, + + [Parameter(ParameterSetName='Remove', Mandatory=$true)] + [switch] + ${Remove}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppDisablingConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [AllowNull()] + [AllowEmptyString()] + [string] + ${AppDomain}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppHostingQuotaConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [double] + ${AppHostingLicenseQuota}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [double] + ${AppInstanceCountQuota}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppManagementDeploymentId { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${DeploymentId}, + + [Parameter(ValueFromPipeline=$true)] + [Alias('Subscription')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${AppManagementServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppPrincipalPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${AppPrincipal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Right}, + + [switch] + ${EnableAppOnlyPolicy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppScaleProfile { + [CmdletBinding()] +param( + [ValidateNotNullOrEmpty()] + [string] + ${MaxDatabaseSize}, + + [ValidateRange(1, 255)] + [int] + ${RemoteWebSiteInstanceCount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppSiteDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppSiteSubscriptionName { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [object] + ${SiteSubscription}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppStateUpdateInterval { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${AppStateSyncHours}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${FastAppRevocationHours}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppStoreConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Url}, + + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAuthenticationRealm { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [string] + ${Realm}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBingMapsBlock { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, HelpMessage='Block Bing Maps in all locales.')] + [switch] + ${BlockBingMapsInAllLocales}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBingMapsKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, HelpMessage='Enter the Bing Maps API key.')] + [string] + ${BingKey}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBrowserCustomerExperienceImprovementProgram { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(ParameterSetName='Farm', Mandatory=$true)] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true)] + [object] + ${SiteSubscription}, + + [switch] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(DefaultParameterSetName='NameValue', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Display')] + [string] + ${DisplayName}, + + [Parameter(ParameterSetName='NameRemove')] + [Parameter(ParameterSetName='NameValue')] + [ValidateNotNull()] + [string] + ${PropertyName}, + + [Parameter(ParameterSetName='NameValue')] + [psobject] + ${PropertyValue}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='NameRemove')] + [switch] + ${Remove}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${Sharing}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseUsername}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogThrottleConfig { + [CmdletBinding(DefaultParameterSetName='MaxDefault', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='MaxDefault', Mandatory=$true)] + [int] + ${Maximum}, + + [Parameter(ParameterSetName='MaxDefault', Mandatory=$true)] + [int] + ${Default}, + + [Parameter(ParameterSetName='Enforcement', Mandatory=$true)] + [switch] + ${Enforced}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPCentralAdministration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [int] + ${Port}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Enabled}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPContentDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Status}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Description}, + + [object] + ${Scope}, + + [string] + ${Schedule}, + + [switch] + ${ScheduleEnabled}, + + [switch] + ${IncrementalEnabled}, + + [object] + ${SqlSnapshotSetting}, + + [switch] + ${HostingSupportEnabled}, + + [object] + ${EmailNotifications}, + + [string[]] + ${EmailAddresses}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Description}, + + [uri] + ${DestinationCentralAdministrationURL}, + + [object] + ${Authentication}, + + [pscredential] + ${PathAccount}, + + [switch] + ${DeployUserNamesEnabled}, + + [object] + ${DeploySecurityInformation}, + + [switch] + ${EventReceiversEnabled}, + + [switch] + ${CompressionEnabled}, + + [switch] + ${PathEnabled}, + + [object] + ${KeepTemporaryFilesOptions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPCustomLayoutsPage { + [CmdletBinding(DefaultParameterSetName='CustomPage', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='CustomPage', Mandatory=$true)] + [string] + ${RelativePath}, + + [Parameter(ParameterSetName='CustomPage')] + [Parameter(ParameterSetName='ResetCustomPage')] + [ValidateRange(14, 15)] + [int] + ${CompatibilityLevel}, + + [Parameter(ParameterSetName='ResetCustomPage', Mandatory=$true)] + [switch] + ${Reset}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateLength(0, 255)] + [string] + ${DisplayName}, + + [ValidateLength(0, 255)] + [string] + ${Description}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [ValidateSet('true','false')] + [string] + ${WebAccessible}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDesignerSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [bool] + ${AllowDesigner}, + + [bool] + ${AllowRevertFromTemplate}, + + [bool] + ${AllowMasterPageEditing}, + + [bool] + ${ShowURLStructure}, + + [string] + ${RequiredDesignerVersion}, + + [string] + ${DesignerDownloadUrl}, + + [bool] + ${AllowCreateDeclarativeWorkflow}, + + [bool] + ${AllowSavePublishDeclarativeWorkflow}, + + [bool] + ${AllowSaveDeclarativeWorkflowAsTemplate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDiagnosticConfig { + [CmdletBinding()] +param( + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${AllowLegacyTraceProviders}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${AppAnalyticsAutomaticUploadEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${CustomerExperienceImprovementProgramEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ErrorReportingEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ErrorReportingAutomaticUploadEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${DownloadErrorReportingUpdatesEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 366)] + [int] + ${DaysToKeepLogs}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${LogMaxDiskSpaceUsageEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1000)] + [int] + ${LogDiskSpaceUsageGB}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${LogLocation}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${LogCutInterval}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${EventLogFloodProtectionEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 100)] + [int] + ${EventLogFloodProtectionThreshold}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionTriggerPeriod}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionQuietPeriod}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionNotifyInterval}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ScriptErrorReportingEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ScriptErrorReportingRequireAuth}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${ScriptErrorReportingDelay}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDiagnosticsProvider { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Enable}, + + [ValidateRange(1, 31)] + [int] + ${DaysRetained}, + + [ValidateRange(1, 9223372036854775807)] + [long] + ${MaxTotalSizeInBytes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDistributedCacheClientSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${DistributedCacheClientSettings}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEduServiceSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [object] + ${Service}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(Position=0)] + [bool] + ${Enabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchAdministrationComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${StoragePath}, + + [object] + ${SearchServiceInstance}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentEnrichmentConfiguration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(DefaultParameterSetName='NoSchedule', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('t')] + [string] + ${Tag}, + + [Alias('s')] + [string] + ${StartAddresses}, + + [Alias('p')] + [object] + ${CrawlPriority}, + + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='Daily', Mandatory=$true)] + [Parameter(ParameterSetName='RemoveSchedule')] + [Parameter(ParameterSetName='MonthlyDate')] + [object] + ${ScheduleType}, + + [Parameter(ParameterSetName='Daily')] + [Alias('daily')] + [switch] + ${DailyCrawlSchedule}, + + [Parameter(ParameterSetName='Weekly')] + [Alias('weekly')] + [switch] + ${WeeklyCrawlSchedule}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('monthly')] + [switch] + ${MonthlyCrawlSchedule}, + + [Parameter(ParameterSetName='RemoveSchedule')] + [switch] + ${RemoveCrawlSchedule}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('start')] + [System.Nullable[datetime]] + ${CrawlScheduleStartDateTime}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('duration')] + [System.Nullable[int]] + ${CrawlScheduleRepeatDuration}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('interval')] + [System.Nullable[int]] + ${CrawlScheduleRepeatInterval}, + + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('every')] + [System.Nullable[int]] + ${CrawlScheduleRunEveryInterval}, + + [Parameter(ParameterSetName='Weekly')] + [object] + ${CrawlScheduleDaysOfWeek}, + + [Parameter(ParameterSetName='MonthlyDate')] + [System.Nullable[int]] + ${CrawlScheduleDaysOfMonth}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('month')] + [object] + ${CrawlScheduleMonthsOfYear}, + + [System.Nullable[int]] + ${MaxPageEnumerationDepth}, + + [System.Nullable[int]] + ${MaxSiteEnumerationDepth}, + + [object] + ${BDCApplicationProxyGroup}, + + [string[]] + ${LOBSystemSet}, + + [string] + ${CustomProtocol}, + + [System.Nullable[bool]] + ${EnableContinuousCrawls}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [string] + ${UserNames}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('t')] + [object] + ${Type}, + + [System.Nullable[bool]] + ${IsAdvancedRegularExpression}, + + [System.Nullable[bool]] + ${CrawlAsHttp}, + + [System.Nullable[bool]] + ${FollowComplexUrls}, + + [System.Nullable[int]] + ${PluggableSecurityTimmerId}, + + [System.Nullable[bool]] + ${SuppressIndexing}, + + [System.Nullable[int]] + ${Priority}, + + [string] + ${ContentClass}, + + [object] + ${AuthenticationType}, + + [string] + ${AccountName}, + + [securestring] + ${AccountPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchFileFormatState { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [bool] + ${Enable}, + + [Parameter(Position=2)] + [System.Nullable[bool]] + ${UseIFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchLinguisticComponentsStatus { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [System.Nullable[bool]] + ${ThesaurusEnabled}, + + [System.Nullable[bool]] + ${StemmingEnabled}, + + [System.Nullable[bool]] + ${QuerySpellingEnabled}, + + [System.Nullable[bool]] + ${EntityExtractionEnabled}, + + [System.Nullable[bool]] + ${AllEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [System.Nullable[bool]] + ${DiscoverNewProperties}, + + [Alias('m')] + [System.Nullable[bool]] + ${MapToContents}, + + [Alias('auto')] + [System.Nullable[bool]] + ${AutoCreateNewManagedProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [Alias('im')] + [System.Nullable[bool]] + ${IsMappedToContents}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('f')] + [System.Nullable[bool]] + ${FullTextQueriable}, + + [Alias('r')] + [System.Nullable[bool]] + ${Retrievable}, + + [Alias('e')] + [System.Nullable[bool]] + ${EnabledForScoping}, + + [Alias('nn')] + [System.Nullable[bool]] + ${NameNormalized}, + + [Alias('rp')] + [System.Nullable[bool]] + ${RespectPriority}, + + [Alias('rd')] + [System.Nullable[bool]] + ${RemoveDuplicates}, + + [Alias('im5')] + [Obsolete('This property is replaced by IncludeInAlertSignature.')] + [System.Nullable[bool]] + ${IncludeInMd5}, + + [Alias('ia')] + [System.Nullable[bool]] + ${IncludeInAlertSignature}, + + [Alias('sfa')] + [System.Nullable[bool]] + ${SafeForAnonymous}, + + [Alias('nw')] + [System.Nullable[bool]] + ${NoWordBreaker}, + + [Alias('u')] + [System.Nullable[int16]] + ${UserFlags}, + + [Alias('qir')] + [System.Nullable[bool]] + ${EnabledForQueryIndependentRank}, + + [Alias('def')] + [System.Nullable[uint32]] + ${DefaultForQueryIndependentRank}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [object] + ${ManagedProperty}, + + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchPrimaryHostController { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SearchServiceInstance}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('l')] + [System.Nullable[float]] + ${Level}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Alias('t')] + [string] + ${Term}, + + [Alias('d')] + [string] + ${Definition}, + + [Alias('c')] + [string] + ${Contact}, + + [Alias('s')] + [System.Nullable[datetime]] + ${StartDate}, + + [Alias('e')] + [System.Nullable[datetime]] + ${EndDate}, + + [Alias('r')] + [System.Nullable[datetime]] + ${ReviewDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [uri] + ${Url}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [string] + ${AlternateResultsPage}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('disp')] + [System.Nullable[bool]] + ${DisplayInAdminUI}, + + [Alias('type')] + [System.Nullable[int]] + ${CompilationType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Alias('n')] + [object] + ${Scope}, + + [Alias('f')] + [string] + ${FilterBehavior}, + + [Alias('ut')] + [string] + ${UrlScopeRuleType}, + + [Alias('text')] + [string] + ${MatchingString}, + + [Alias('value')] + [string] + ${PropertyValue}, + + [Alias('mname')] + [string] + ${ManagedPropertyName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQuerySpellingCorrection { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [System.Nullable[bool]] + ${ContentAlignmentEnabled}, + + [System.Nullable[int]] + ${MaxDictionarySize}, + + [System.Nullable[bool]] + ${DiacriticsInSuggestionsEnabled}, + + [System.Nullable[int]] + ${TermFrequencyThreshold}, + + [System.Nullable[bool]] + ${SecurityTrimmingEnabled}, + + [object] + ${SpellingDictionary}, + + [System.Nullable[timespan]] + ${MaxProcessingTime}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(Mandatory=$true)] + [string] + ${RankingModelXML}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchResultItemType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('rule')] + [object] + ${Rules}, + + [Alias('priority')] + [System.Nullable[int]] + ${RulePriority}, + + [Alias('dp')] + [string] + ${DisplayProperties}, + + [Alias('sid')] + [System.Nullable[guid]] + ${SourceID}, + + [Alias('url')] + [string] + ${DisplayTemplateUrl}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Alias('opt')] + [System.Nullable[bool]] + ${OptimizeForFrequentUse}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('o')] + [object] + ${Owner}, + + [string] + ${Name}, + + [string] + ${Description}, + + [string] + ${QueryTemplate}, + + [guid] + ${ProviderId}, + + [string] + ${RemoteUrl}, + + [System.Nullable[bool]] + ${AutoDiscover}, + + [object] + ${AuthenticationType}, + + [string] + ${UserName}, + + [string] + ${Password}, + + [string] + ${SsoId}, + + [System.Nullable[bool]] + ${MakeDefault}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${ServiceAccount}, + + [securestring] + ${ServicePassword}, + + [string] + ${ContactEmail}, + + [string] + ${ConnectionTimeout}, + + [string] + ${AcknowledgementTimeout}, + + [string] + ${ProxyType}, + + [string] + ${IgnoreSSLWarnings}, + + [string] + ${InternetIdentity}, + + [string] + ${PerformanceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${DiacriticSensitive}, + + [object] + ${DefaultSearchProvider}, + + [string] + ${VerboseQueryMonitoring}, + + [object] + ${ApplicationPool}, + + [object] + ${AdminApplicationPool}, + + [string] + ${DefaultContentAccessAccountName}, + + [securestring] + ${DefaultContentAccessAccountPassword}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${DefaultIndexLocation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPExcelBIServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${ServerId}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPExcelDataConnectionLibrary { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Address}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPExcelDataProvider { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${ProviderId}, + + [object] + ${ProviderType}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPExcelFileLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Address}, + + [object] + ${LocationType}, + + [switch] + ${IncludeChildren}, + + [int] + ${SessionTimeout}, + + [int] + ${ShortSessionTimeout}, + + [int] + ${NewWorkbookSessionTimeout}, + + [int] + ${RequestDurationMax}, + + [int] + ${ChartRenderDurationMax}, + + [int] + ${WorkbookSizeMax}, + + [int] + ${ChartAndImageSizeMax}, + + [int] + ${AutomaticVolatileFunctionCacheLifetime}, + + [object] + ${DefaultWorkbookCalcMode}, + + [object] + ${ExternalDataAllowed}, + + [switch] + ${WarnOnDataRefresh}, + + [switch] + ${DisplayGranularExtDataErrors}, + + [switch] + ${AbortOnRefreshOnOpenFail}, + + [int] + ${PeriodicExtDataCacheLifetime}, + + [int] + ${ManualExtDataCacheLifetime}, + + [int] + ${ConcurrentDataRequestsPerSessionMax}, + + [switch] + ${UdfsAllowed}, + + [string] + ${Description}, + + [switch] + ${RESTExternalDataAllowed}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPExcelServiceApplication { + [CmdletBinding(DefaultParameterSetName='ExistingTargetApplicationParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [int] + ${ExternalDataConnectionLifetime}, + + [Parameter(ParameterSetName='ExistingTargetApplicationParameterSet')] + [string] + ${UnattendedAccountApplicationId}, + + [object] + ${LoadBalancingScheme}, + + [int] + ${SessionsPerUserMax}, + + [int] + ${PrivateBytesMax}, + + [int] + ${MemoryCacheThreshold}, + + [int] + ${UnusedObjectAgeMax}, + + [int] + ${ThrottleAccessViolationsPerSiteCollection}, + + [int] + ${SiteCollectionAnonymousSessionsMax}, + + [string] + ${WorkbookCache}, + + [int] + ${WorkbookCacheSizeMax}, + + [switch] + ${CachingOfUnusedFilesEnable}, + + [object] + ${FileAccessMethod}, + + [object] + ${EncryptedUserConnectionRequired}, + + [switch] + ${CrossDomainAccessAllowed}, + + [switch] + ${TerminateProcessOnAccessViolation}, + + [switch] + ${UseEffectiveUserName}, + + [string] + ${WorkbookModelUsageTracker}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='NewTargetApplicationParameterSet')] + [pscredential] + ${UnattendedServiceAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPExcelUserDefinedFunction { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Assembly}, + + [object] + ${AssemblyLocation}, + + [switch] + ${Enable}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ExcelServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPFarmConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowBatchSize}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowPostponeThreshold}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowEventDeliveryTimeout}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${InstalledProductsRefresh}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${DataFormWebPartAutoRefreshEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${ASPScriptOptimizationEnabled}, + + [switch] + ${ServiceConnectionPointDelete}, + + [string] + ${ServiceConnectionPointBindingInformation}, + + [switch] + ${Force}, + + [System.Nullable[switch]] + ${UserAccountDirectoryPathIsImmutable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInfoPathFormsService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Identity}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormBrowserEnabling}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormBrowserRendering}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${DefaultDataConnectionTimeout}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MemoryCacheSize}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MaxDataConnectionTimeout}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MaxDataConnectionResponseSize}, + + [ValidateSet('true','false')] + [string] + ${RequireSslForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowEmbeddedSqlForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowUdcAuthenticationForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormCrossDomainDataConnections}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${MaxPostbacksPerSession}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${MaxUserActionsPerPostback}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${ActiveSessionTimeout}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxSizeOfUserFormState}, + + [ValidateSet('true','false')] + [string] + ${AllowViewState}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${ViewStateThreshold}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxFormLoadTime}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxDataConnectionRoundTrip}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInfoPathWebServiceProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateSet('true','false')] + [string] + ${AllowWebServiceProxy}, + + [ValidateSet('true','false')] + [string] + ${AllowForUserForms}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInternalAppStateUpdateInterval { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${AppStateSyncHours}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPIRMSettings { + [CmdletBinding(DefaultParameterSetName='UseServiceDiscovery', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [switch] + ${IrmEnabled}, + + [switch] + ${SubscriptionScopeSettingsEnabled}, + + [Parameter(ParameterSetName='UseServiceDiscovery')] + [switch] + ${UseActiveDirectoryDiscovery}, + + [Parameter(ParameterSetName='UseSpecifiedCertificateUrl', Mandatory=$true)] + [uri] + ${CertificateServerUrl}, + + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ServiceAuthenticationCertificate}, + + [ValidateNotNull()] + [securestring] + ${CertificatePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPLogLevel { + [CmdletBinding()] +param( + [string] + ${TraceSeverity}, + + [string] + ${EventSeverity}, + + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Schedule}, + + [int] + ${PreExpireDays}, + + [int] + ${EmailNotification}, + + [Parameter(ParameterSetName='AutoGeneratePassword')] + [switch] + ${AutoGeneratePassword}, + + [Parameter(ParameterSetName='NewPasswordAsParameter', Mandatory=$true)] + [securestring] + ${Password}, + + [Parameter(ParameterSetName='NewPassword')] + [switch] + ${SetNewPassword}, + + [Parameter(ParameterSetName='NewPassword', Mandatory=$true)] + [securestring] + ${NewPassword}, + + [Parameter(ParameterSetName='NewPassword', Mandatory=$true)] + [securestring] + ${ConfirmPassword}, + + [Parameter(ParameterSetName='ExistingPassword')] + [switch] + ${UseExistingPassword}, + + [Parameter(ParameterSetName='ExistingPassword', Mandatory=$true)] + [securestring] + ${ExistingPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMetadataServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [string] + ${AdministratorAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${FullAccessAccount}, + + [string] + ${HubUri}, + + [int] + ${CacheTimeCheckInterval}, + + [int] + ${MaxChannelCache}, + + [switch] + ${DoNotUnpublishAllPackages}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Quota', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [string] + ${ReadAccessAccount}, + + [string] + ${RestrictedAccount}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true)] + [switch] + ${DisablePartitionQuota}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${GroupsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermSetsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${LabelsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${PropertiesPerPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMetadataServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [switch] + ${ContentTypeSyndicationEnabled}, + + [switch] + ${ContentTypePushdownEnabled}, + + [switch] + ${DefaultKeywordTaxonomy}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${DefaultSiteCollectionTaxonomy}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMobileMessagingAccount { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [Alias('ServiceType','AccountType')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [string] + ${ServiceName}, + + [string] + ${ServiceUrl}, + + [string] + ${UserId}, + + [string] + ${Password}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPODataConnectionSetting { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 246)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${ServiceAddressURL}, + + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [string] + ${ExtensionProvider}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPODataConnectionSettingMetadata { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateLength(0, 255)] + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${ServiceAddressMetadataURL}, + + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPOfficeStoreAppsDefaultActivation { + [CmdletBinding(DefaultParameterSetName='AppsForOfficeSettingsInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPassPhrase { + [CmdletBinding(DefaultParameterSetName='AcrossFarm', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [securestring] + ${PassPhrase}, + + [Parameter(ParameterSetName='AcrossFarm', Mandatory=$true)] + [securestring] + ${ConfirmPassPhrase}, + + [Parameter(ParameterSetName='LocalOnly')] + [switch] + ${LocalServerOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPerformancePointSecureDataValues { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [pscredential] + ${DataSourceUnattendedServiceAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [bool] + ${CommentsDisabled}, + + [int] + ${CommentsScorecardMax}, + + [int] + ${IndicatorImageCacheSeconds}, + + [int] + ${DataSourceQueryTimeoutSeconds}, + + [int] + ${FilterRememberUserSelectionsDays}, + + [int] + ${FilterTreeMembersMax}, + + [int] + ${FilterSearchResultsMax}, + + [int] + ${ShowDetailsInitialRows}, + + [bool] + ${ShowDetailsMaxRowsDisabled}, + + [int] + ${ShowDetailsMaxRows}, + + [bool] + ${MSMQEnabled}, + + [string] + ${MSMQName}, + + [int] + ${SessionHistoryHours}, + + [bool] + ${AnalyticQueryLoggingEnabled}, + + [bool] + ${TrustedDataSourceLocationsRestricted}, + + [bool] + ${TrustedContentLocationsRestricted}, + + [int] + ${SelectMeasureMaximum}, + + [int] + ${DecompositionTreeMaximum}, + + [bool] + ${ApplicationProxyCacheEnabled}, + + [bool] + ${ApplicationCacheEnabled}, + + [int] + ${ApplicationCacheMinimumHitCount}, + + [int] + ${AnalyticResultCacheMinimumHitCount}, + + [int] + ${ElementCacheSeconds}, + + [int] + ${AnalyticQueryCellMax}, + + [string] + ${SettingsDatabase}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseSQLAuthenticationCredential}, + + [string] + ${DatabaseFailoverServer}, + + [bool] + ${DatabaseUseWindowsAuthentication}, + + [string] + ${DataSourceUnattendedServiceAccountTargetApplication}, + + [bool] + ${UseEffectiveUserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPowerPointConversionServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [uint32] + ${CacheExpirationPeriodInSeconds}, + + [uint32] + ${WorkerProcessCount}, + + [uint32] + ${WorkerKeepAliveTimeoutInSeconds}, + + [uint32] + ${WorkerTimeoutInSeconds}, + + [uint32] + ${MaximumConversionsPerWorker}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [string] + ${Name}, + + [object] + ${ApplicationPool}, + + [pscredential] + ${ProfileDBCredentials}, + + [string] + ${ProfileDBFailoverServer}, + + [pscredential] + ${SocialDBCredentials}, + + [string] + ${SocialDBFailoverServer}, + + [pscredential] + ${ProfileSyncDBCredentials}, + + [string] + ${ProfileSyncDBFailoverServer}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [bool] + ${PurgeNonImportedObjects}, + + [bool] + ${UseOnlyPreferredDomainControllers}, + + [bool] + ${GetNonImportedObjects}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProfileServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [string] + ${Name}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProfileServiceApplicationSecurity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [ValidateSet('UserACL','MySiteReaderACL')] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRequestManagementSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [System.Nullable[switch]] + ${RoutingEnabled}, + + [ValidateNotNull()] + [System.Nullable[switch]] + ${ThrottlingEnabled}, + + [ValidateNotNull()] + [object] + ${RoutingScheme}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Availability}, + + [ValidateNotNull()] + [object] + ${OutgoingScheme}, + + [ValidateRange(1, 65535)] + [ValidateNotNull()] + [System.Nullable[int]] + ${OutgoingPort}, + + [ValidateNotNull()] + [switch] + ${ClearOutgoingPort}, + + [ValidateNotNull()] + [System.Nullable[double]] + ${StaticWeight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${MachineTargets}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [object] + ${MachinePool}, + + [ValidateNotNull()] + [System.Nullable[int]] + ${ExecutionGroup}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPScaleOutDatabaseDataRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [object] + ${Range}, + + [byte[]] + ${NewRangePoint}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPScaleOutDatabaseDataSubRange { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [byte[]] + ${SubRangePoint}, + + [Parameter(Mandatory=$true)] + [object] + ${SubRangeMode}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [switch] + ${IgnoreSubRangePointOnBoundary}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecureStoreApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Administrator}, + + [object] + ${CredentialsOwnerGroup}, + + [object] + ${Fields}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [object] + ${TargetApplication}, + + [object] + ${TicketRedeemer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecureStoreDefaultProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [type] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecureStoreServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${ApplicationPool}, + + [switch] + ${AuditingEnabled}, + + [System.Nullable[int]] + ${AuditlogMaxSize}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseName}, + + [securestring] + ${DatabasePassword}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Sharing}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecurityTokenServiceConfig { + [CmdletBinding(DefaultParameterSetName='SigningCertificateImport', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='SigningCertificateImport')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportSigningCertificate}, + + [Parameter(ParameterSetName='SigningCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SigningCertificateThumbprint}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${SigningCertificateStoreName}, + + [Parameter(ParameterSetName='SigningCertificateQueue')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${QueueSigningCertificate}, + + [Parameter(ParameterSetName='QueueSigningCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${QueueSigningCertificateThumbprint}, + + [Parameter(ParameterSetName='QueueSigningCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${QueueSigningCertificateStoreName}, + + [Parameter(ParameterSetName='SigningCertificateRevoke')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${RevokeSigningCertificate}, + + [Parameter(ParameterSetName='RevokeSigningCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${RevokeSigningCertificateThumbprint}, + + [Parameter(ParameterSetName='RevokeSigningCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${RevokeSigningCertificateStoreName}, + + [int] + ${ServiceTokenLifetime}, + + [int] + ${ServiceTokenCacheExpirationWindow}, + + [int] + ${FormsTokenLifetime}, + + [int] + ${WindowsTokenLifetime}, + + [int] + ${MaxLogonTokenCacheItems}, + + [int] + ${MaxServiceTokenCacheItems}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServerScaleOutDatabaseDataRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [object] + ${Range}, + + [byte[]] + ${NewRangePoint}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServerScaleOutDatabaseDataSubRange { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [byte[]] + ${SubRangePoint}, + + [Parameter(Mandatory=$true)] + [object] + ${SubRangeMode}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [switch] + ${IgnoreSubRangePointOnBoundary}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${DefaultEndpoint}, + + [ValidateNotNull()] + [object] + ${ServiceApplicationProxyGroup}, + + [ValidateNotNull()] + [object] + ${IisWebServiceApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplicationEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='HostName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${HostName}, + + [Parameter(ParameterSetName='ResetHostName', Mandatory=$true)] + [switch] + ${ResetHostName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Position=1)] + [object] + ${Account}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplicationSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${ObjectSecurity}, + + [switch] + ${Admin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceHostConfig { + [CmdletBinding(DefaultParameterSetName='SslCertificateImport', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='SslCertificateImport', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SslCertificateReference', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [Alias('Port')] + [ValidateRange(1, 65535)] + [int] + ${HttpPort}, + + [Parameter(ParameterSetName='SslCertificateImport')] + [Parameter(ParameterSetName='SslCertificateReference')] + [Alias('SecurePort')] + [ValidateRange(1, 65535)] + [int] + ${HttpsPort}, + + [Parameter(ParameterSetName='SslCertificateImport')] + [Parameter(ParameterSetName='SslCertificateReference')] + [ValidateRange(1, 65535)] + [int] + ${NetTcpPort}, + + [Parameter(ParameterSetName='SslCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SslCertificateThumbprint}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${SslCertificateStoreName}, + + [Parameter(ParameterSetName='SslCertificateImport')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportSslCertificate}, + + [switch] + ${NoWait}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSessionStateService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [System.Nullable[int]] + ${SessionTimeout}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSite { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default')] + [object] + ${OwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${QuotaTemplate}, + + [Parameter(ParameterSetName='Default')] + [object] + ${Template}, + + [Parameter(ParameterSetName='Default')] + [string] + ${Url}, + + [Parameter(ParameterSetName='Default')] + [long] + ${MaxSize}, + + [Parameter(ParameterSetName='Default')] + [long] + ${WarningSize}, + + [Parameter(ParameterSetName='Default')] + [string] + ${SharingType}, + + [Parameter(ParameterSetName='Default')] + [ValidateSet('Unlock','NoAdditions','ReadOnly','NoAccess')] + [string] + ${LockState}, + + [Parameter(ParameterSetName='Default')] + [object] + ${SecondaryOwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [string] + ${UserAccountDirectoryPath}, + + [Parameter(ParameterSetName='SiteSubscription')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='SiteSubscription')] + [switch] + ${Force}, + + [object] + ${AdministrationSiteType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteAdministration { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default')] + [object] + ${OwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${SecondaryOwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${Template}, + + [Parameter(ParameterSetName='Default')] + [ValidateSet('Unlock','NoAdditions','ReadOnly','NoAccess')] + [string] + ${LockState}, + + [Parameter(ParameterSetName='Default')] + [long] + ${MaxSize}, + + [Parameter(ParameterSetName='Default')] + [long] + ${WarningSize}, + + [Parameter(ParameterSetName='SiteSubscription')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='SiteSubscription')] + [switch] + ${Force}, + + [object] + ${AdministrationSiteType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${UserAccountDirectoryPath}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${FeaturePack}, + + [switch] + ${PassThru}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionEdiscoveryHub { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${SearchScope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionIRMConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${IrmEnabled}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${CertificateServerUrl}, + + [switch] + ${PassThru}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionMetadataConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${HubUri}, + + [switch] + ${DoNotUnpublishAllPackages}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [string] + ${SynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${Zone}, + + [Parameter(Mandatory=$true)] + [string] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPStateServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPStateServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Application')] + [object] + ${ServiceApplication}, + + [ValidateRange(1, 10)] + [System.Nullable[int]] + ${Weight}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSubscriptionSettingsServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [ValidateNotNull()] + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Threshold}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Schedule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTopologyServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${LoadBalancerUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTopologyServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${BadListPeriod}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTranslationServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${DatabaseServer}, + + [string] + ${FailoverDatabaseServer}, + + [System.Nullable[int]] + ${TimerJobFrequency}, + + [System.Nullable[int]] + ${MaximumTranslationAttempts}, + + [System.Nullable[int]] + ${KeepAliveTimeout}, + + [System.Nullable[int]] + ${MaximumTranslationTime}, + + [System.Nullable[int]] + ${TranslationsPerInstance}, + + [System.Nullable[int]] + ${MaximumSyncTranslationRequests}, + + [System.Nullable[int]] + ${RecycleProcessThreshold}, + + [System.Nullable[int]] + ${TotalActiveProcesses}, + + [string] + ${MachineTranslationClientId}, + + [string] + ${MachineTranslationCategory}, + + [switch] + ${UseDefaultInternetSettings}, + + [string] + ${WebProxyAddress}, + + [string] + ${MachineTranslationAddress}, + + [System.Nullable[int]] + ${JobExpirationDays}, + + [System.Nullable[int]] + ${MaximumItemsPerDay}, + + [System.Nullable[int]] + ${MaximumItemsPerPartitionPerDay}, + + [System.Nullable[int]] + ${MaximumBinaryFileSize}, + + [System.Nullable[int]] + ${MaximumTextFileSize}, + + [System.Nullable[int]] + ${MaximumWordCharacterCount}, + + [System.Nullable[bool]] + ${DisableBinaryFileScan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string[]] + ${AddEnabledFileExtensions}, + + [string[]] + ${RemoveEnabledFileExtensions}, + + [switch] + ${ClearEnabledFileExtensions}, + + [switch] + ${EnableAllFileExtensions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTranslationServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [System.Nullable[int]] + ${MaximumGroupSize}, + + [System.Nullable[int]] + ${MaximumItemCount}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTranslationThrottlingSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [System.Nullable[int]] + ${SiteQuota}, + + [System.Nullable[int]] + ${TenantQuota}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportTrustCertificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [object] + ${ClaimsMappings}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${SignInUrl}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [string] + ${Realm}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [switch] + ${UseWReply}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [string] + ${RegisteredIssuerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ManualUpdateCertificateParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [string] + ${RegisteredIssuerName}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IsTrustBroker}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${UsageService}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 135)] + [string] + ${DatabaseServer}, + + [ValidateLength(1, 128)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseUsername}, + + [ValidateNotNull()] + [securestring] + ${DatabasePassword}, + + [switch] + ${EnableLogging}, + + [ValidateLength(1, 135)] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUsageDefinition { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Enable}, + + [ValidateRange(0, 31)] + [int] + ${DaysRetained}, + + [ValidateRange(0, 31)] + [int] + ${DaysToKeepUsageFiles}, + + [ValidateRange(1, 9223372036854775807)] + [long] + ${MaxTotalSizeInBytes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUsageService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The max space, in GB, that Usage log files should take up.')] + [ValidateRange(1, 20)] + [uint32] + ${UsageLogMaxSpaceGB}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The location where Usage log files are created.')] + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 181)] + [string] + ${UsageLogLocation}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The time interval, in minutes, that Usage log files should be cut and start a new one.')] + [ValidateRange(1, 1440)] + [uint32] + ${UsageLogCutTime}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The max usage file size, in KB, that Usage log files should be cut and start a new one.')] + [ValidateRange(512, 65536)] + [uint32] + ${UsageLogMaxFileSizeKB}, + + [System.Nullable[bool]] + ${LoggingEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Web}, + + [object] + ${Group}, + + [string] + ${DisplayName}, + + [switch] + ${SyncFromAD}, + + [string[]] + ${AddPermissionLevel}, + + [string[]] + ${RemovePermissionLevel}, + + [switch] + ${ClearPermissions}, + + [switch] + ${PassThru}, + + [string] + ${Email}, + + [switch] + ${IsSiteCollectionAdmin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioExternalData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UnattendedServiceAccountApplicationID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioPerformance { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [long] + ${MaxDiagramSize}, + + [Parameter(Mandatory=$true)] + [int] + ${MinDiagramCacheAge}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${MaxDiagramCacheAge}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${MaxRecalcDuration}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [long] + ${MaxCacheSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true)] + [int] + ${DataProviderType}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ServiceApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${RelativeUrl}, + + [string] + ${Description}, + + [object] + ${Template}, + + [Obsolete('This control applies to SharePoint 2007 theming and is no longer functional')] + [string] + ${Theme}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWebApplication { + [CmdletBinding(DefaultParameterSetName='UpdateGeneralSettings', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='UpdateClaimSettings', Mandatory=$true)] + [object] + ${Zone}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [int] + ${DefaultTimeZone}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [string] + ${DefaultQuotaTemplate}, + + [Parameter(ParameterSetName='UpdateMailSettings', Mandatory=$true)] + [string] + ${SMTPServer}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [string] + ${OutgoingEmailAddress}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [string] + ${ReplyToEmailAddress}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [Alias('ProxyGroup')] + [object] + ${ServiceApplicationProxyGroup}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${AuthenticationProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${AdditionalClaimProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [string] + ${SignInRedirectURL}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${SignInRedirectProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWebApplicationHttpThrottlingMonitor { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(Mandatory=$true, Position=2, ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Upper')] + [ValidateRange(0, 1.7976931348623157E+308)] + [double] + ${UpperLimit}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Lower')] + [ValidateRange(0, 1.7976931348623157E+308)] + [double] + ${LowerLimit}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Buckets')] + [double[]] + ${HealthScoreBuckets}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${IsDESC}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [switch] + ${DefaultAction}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWOPIZone { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWordConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${DatabaseServer}, + + [System.Nullable[int]] + ${TimerJobFrequency}, + + [System.Nullable[int]] + ${ConversionTimeout}, + + [System.Nullable[int]] + ${MaximumConversionAttempts}, + + [System.Nullable[int]] + ${KeepAliveTimeout}, + + [System.Nullable[int]] + ${MaximumConversionTime}, + + [System.Nullable[int]] + ${MaximumSyncConversionRequests}, + + [System.Nullable[int]] + ${ConversionsPerInstance}, + + [switch] + ${DisableEmbeddedFonts}, + + [switch] + ${DisableBinaryFileScan}, + + [System.Nullable[int]] + ${RecycleProcessThreshold}, + + [System.Nullable[int]] + ${ActiveProcesses}, + + [System.Nullable[int]] + ${MaximumMemoryUsage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string[]] + ${AddSupportedFormats}, + + [string[]] + ${RemoveSupportedFormats}, + + [switch] + ${ClearSupportedFormats}, + + [System.Nullable[int]] + ${MaximumGroupSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWorkflowConfig { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteCollection}, + + [bool] + ${EmailNoPermissionParticipantsEnabled}, + + [bool] + ${SendDocumentToExternalParticipants}, + + [bool] + ${DeclarativeWorkflowsEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWorkManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(HelpMessage='This value specifies the minimum amount of time between refreshes for a provider for a given user.')] + [timespan] + ${MinimumTimeBetweenProviderRefreshes}, + + [Parameter(HelpMessage='This value specifies the minimum amount of time between calls to search for a given user.')] + [timespan] + ${MinimumTimeBetweenSearchQueries}, + + [Parameter(HelpMessage='This value specifies the minimum amount of time between calls into our routine that tries to find new tenants that want to sync EWS tasks.')] + [timespan] + ${MinimumTimeBetweenEwsSyncSubscriptionSearches}, + + [Parameter(HelpMessage='This value specifies the maximum number of users a service instance will try to sync on a given tenant via EWS per Timer job interval')] + [uint32] + ${NumberOfUsersPerEwsSyncBatch}, + + [Parameter(HelpMessage='This value specifies the maximum number of users a service instance machine will sync via EWS at one time across all tenants.')] + [uint32] + ${NumberOfUsersEwsSyncWillProcessAtOnce}, + + [Parameter(HelpMessage='This value specifies the maximum number of tenants the service will try to sync via EWS per Timer job interval')] + [uint32] + ${NumberOfSubscriptionSyncsPerEwsSyncRun}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWorkManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Split-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='NewDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseName}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseFailoverServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNull()] + [pscredential] + ${NewDatabaseCredentials}, + + [Parameter(ParameterSetName='ExistingDatabase', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TargetDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceServiceApplication}, + + [int] + ${SourcePercentage}, + + [switch] + ${MoveLowerHalf}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Split-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='NewDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseName}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseFailoverServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNull()] + [pscredential] + ${NewDatabaseCredentials}, + + [Parameter(ParameterSetName='ExistingDatabase', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TargetDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceServiceApplication}, + + [int] + ${SourcePercentage}, + + [switch] + ${MoveLowerHalf}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPAdminJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPAssignment { + [CmdletBinding()] +param( + [switch] + ${Global}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${WaitEnabled}, + + [string] + ${DeploySinceTime}, + + [switch] + ${TestEnabled}, + + [string] + ${UseSpecificSnapshot}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPDiagnosticsSession { + [CmdletBinding()] +param( + [guid] + ${CorrelationId}, + + [switch] + ${Dashboard}, + + [ValidateSet('High','Medium','Monitorable','Unexpected','Verbose','VerboseEx','None')] + [string] + ${TraceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPAssignment { + [CmdletBinding()] +param( + [switch] + ${Global}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${SemiGlobal}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPDiagnosticsSession { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPDistributedCacheServiceInstance { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${Graceful}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(0, 1440)] + [System.Nullable[int]] + ${TimeLeft}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Suspend-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Suspend-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='ContentDatabaseById')] +param( + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNull()] + [object] + ${ServerInstance}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${ShowRowCounts}, + + [switch] + ${ShowLocation}, + + [Parameter(ParameterSetName='ContentDatabaseById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${ExtendedCheck}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPInfoPathFormTemplate { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPSite { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [guid] + ${RuleId}, + + [switch] + ${RunAlways}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPAppInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPFeature { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Force}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPHelpCollection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPSolution { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='OneWebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [string] + ${Time}, + + [switch] + ${Local}, + + [Parameter(ParameterSetName='AllWebApplication', Mandatory=$true)] + [switch] + ${AllWebApplications}, + + [uint32] + ${Language}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPWebPartPack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [uint32] + ${Language}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Unpublish-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPAppCatalogConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [switch] + ${SkipWebTemplateChecking}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPAppInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPDistributedCacheSize { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uint32] + ${CacheSizeInMB}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPFarmEncryptionKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${Resume}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPHelp { + [CmdletBinding()] +param( + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPInfoPathAdminFileUrl { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [uri] + ${Find}, + + [Parameter(Mandatory=$true)] + [uri] + ${Replace}, + + [switch] + ${Scan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPInfoPathUserFileUrl { + [CmdletBinding(DefaultParameterSetName='WebApp', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='WebApp', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDB', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='Site', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [uri] + ${Find}, + + [Parameter(Mandatory=$true)] + [uri] + ${Replace}, + + [switch] + ${Scan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPProfilePhotoStore { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${MySiteHostLocation}, + + [bool] + ${CreateThumbnailsForImportedPhotos}, + + [bool] + ${NoDelete}, + + [uri] + ${OldBaseUri}, + + [uri] + ${NewBaseUri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPRepopulateMicroblogFeedCache { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [ValidateNotNull()] + [string] + ${AccountName}, + + [ValidateNotNull()] + [string] + ${SiteUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPRepopulateMicroblogLMTCache { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreApplicationServerKey { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Passphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreCredentialMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [securestring[]] + ${Values}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreGroupCredentialMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [securestring[]] + ${Values}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreMasterKey { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Passphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${LiteralPath}, + + [string] + ${Time}, + + [switch] + ${CASPolicies}, + + [switch] + ${GACDeployment}, + + [switch] + ${FullTrustBinDeployment}, + + [switch] + ${Local}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [object] + ${ToSolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPWOPIProofKey { + [CmdletBinding()] +param( + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='ContentDatabaseById', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${ServerInstance}, + + [switch] + ${UseSnapshot}, + + [Parameter(ParameterSetName='ContentDatabaseById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1)] + [switch] + ${ForceDeleteLock}, + + [switch] + ${SkipIntegrityChecks}, + + [switch] + ${NoB2BSiteUpgrade}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPEnterpriseSearchServiceApplicationSiteSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPFarm { + [CmdletBinding(DefaultParameterSetName='FarmById', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPSingleSignOnDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SSOConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SecureStoreConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [securestring] + ${SecureStorePassphrase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPSite { + [CmdletBinding(DefaultParameterSetName='SPSiteById', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='SPSiteById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${VersionUpgrade}, + + [switch] + ${QueueOnly}, + + [switch] + ${Email}, + + [switch] + ${Unthrottled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + diff --git a/Tests/Stubs/SharePoint/16.0.4316.1217/Microsoft.SharePoint.PowerShell.psm1 b/Tests/Stubs/SharePoint/16.0.4316.1217/Microsoft.SharePoint.PowerShell.psm1 new file mode 100644 index 000000000..1bbee345f --- /dev/null +++ b/Tests/Stubs/SharePoint/16.0.4316.1217/Microsoft.SharePoint.PowerShell.psm1 @@ -0,0 +1,22281 @@ +function Add-SPAppDeniedEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Endpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPClaimTypeMapping { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [ValidateNotNull()] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPDiagnosticsPerformanceCounter { + [CmdletBinding(DefaultParameterSetName='AddCounter', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AddMultipleCounters', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ParameterSetName='AddMultipleCounters', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [string[]] + ${CounterList}, + + [Parameter(ParameterSetName='AddInstance', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ParameterSetName='AddCounter', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddMultipleCounters', ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='AddInstance', ValueFromPipelineByPropertyName=$true)] + [switch] + ${AllInstances}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPDistributedCacheServiceInstance { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPInfoPathUserAgent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPIPRangeAllowList { + [CmdletBinding(DefaultParameterSetName='CustomIPAllowList', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='CustomIPAllowList', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteName}, + + [Parameter(ParameterSetName='InternalIPAllowList', Mandatory=$true)] + [switch] + ${InternalIPAllowList}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IPV4}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IPV6}, + + [ValidateNotNullOrEmpty()] + [string] + ${IP}, + + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.List[string]] + ${IPList}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPPluggableSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(Mandatory=$true)] + [int] + ${PlugInId}, + + [string] + ${QualifiedTypeName}, + + [System.Collections.Specialized.NameValueCollection] + ${CustomProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPProfileLeader { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPProfileSyncConnection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionForestName}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionDomain}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionUserName}, + + [Parameter(Mandatory=$true)] + [securestring] + ${ConnectionPassword}, + + [string] + ${ConnectionServerName}, + + [int] + ${ConnectionPort}, + + [bool] + ${ConnectionUseSSL}, + + [bool] + ${ConnectionUseDisabledFilter}, + + [string] + ${ConnectionNamingContext}, + + [string] + ${ConnectionSynchronizationOU}, + + [string] + ${ConnectionClaimProviderTypeValue}, + + [string] + ${ConnectionClaimProviderIdValue}, + + [string] + ${ConnectionClaimIDMapAttribute}, + + [bool] + ${ConnectionFilterOutUnlicensed}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Availability}, + + [ValidateNotNull()] + [object] + ${OutgoingScheme}, + + [System.Nullable[int]] + ${OutgoingPort}, + + [ValidateNotNull()] + [System.Nullable[double]] + ${StaticWeight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${MachineTargets}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [object] + ${MachinePool}, + + [ValidateNotNull()] + [System.Nullable[int]] + ${ExecutionGroup}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseFailoverServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSecureStoreSystemAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${AccountName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseFailoverServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPServiceApplicationProxyGroupMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [Alias('Proxy')] + [ValidateNotNull()] + [object] + ${Member}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPShellAdmin { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${UserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSiteSubscriptionFeaturePackMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${FeatureDefinition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [string] + ${SynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${LiteralPath}, + + [uint32] + ${Language}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RequestManagementSettings}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [ValidateNotNull()] + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Threshold}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPUserLicenseMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, ValueFromRemainingArguments=$true)] + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.List`1[[object]]] + ${Mapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Add-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${LiteralPath}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPConfigurationDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet')] +param( + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [string] + ${Directory}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPEnterpriseSearchServiceApplicationIndex { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='RunBackup', Mandatory=$true, Position=0)] + [int] + ${Phase}, + + [Parameter(ParameterSetName='AbortBackup', Mandatory=$true, Position=0)] + [switch] + ${Abort}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='RunBackup', Mandatory=$true, Position=2)] + [string] + ${BackupFolder}, + + [Parameter(Mandatory=$true, Position=3)] + [string] + ${BackupHandleFile}, + + [Parameter(Position=4)] + [int] + ${Retries}, + + [Parameter(Position=5)] + [switch] + ${PeerToPeer}, + + [Parameter(Position=6)] + [string] + ${SpecifiedBackupHandle}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPFarm { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [string] + ${Directory}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [ValidateSet('Full','Differential','None')] + [string] + ${BackupMethod}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${BackupThreads}, + + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${Force}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [switch] + ${ConfigurationOnly}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${Percentage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Backup-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${UseSqlSnapshot}, + + [switch] + ${NoSiteLock}, + + [switch] + ${UseABSDocStreamInfo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPAppDeniedEndpointList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPDistributedCacheItem { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPLogLevel { + [CmdletBinding()] +param( + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPMetadataWebServicePartitionData { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceProxy}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [switch] + ${FromServiceDatabase}, + + [ValidateNotNull()] + [object] + ${FromContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [object] + ${TrustedLocationType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPScaleOutDatabaseDeletedDataSubRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPScaleOutDatabaseLog { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [int] + ${LogEntryTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPSecureStoreCredentialMapping { + [CmdletBinding(DefaultParameterSetName='OneApplication', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='AllApplications', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ParameterSetName='OneApplication', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(ParameterSetName='AllApplications', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPSecureStoreDefaultProvider { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPServerScaleOutDatabaseDeletedDataSubRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPServerScaleOutDatabaseLog { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [int] + ${LogEntryTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Clear-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Compare-SPDatabaseSchema { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Source}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Target}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Connect-SPConfigurationDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(Mandatory=$true, Position=8, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [securestring] + ${Passphrase}, + + [Parameter(Position=9, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SkipRegisterAsDistributedCacheHost}, + + [string] + ${DatabaseFailOverPartner}, + + [object] + ${LocalServerRole}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Convert-SPWebApplication { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateSet('LEGACY','CLAIMS-WINDOWS','CLAIMS-TRUSTED-DEFAULT')] + [string] + ${From}, + + [Parameter(ParameterSetName='Claims', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateSet('CLAIMS','CLAIMS-WINDOWS','CLAIMS-TRUSTED-DEFAULT','CLAIMS-SHAREPOINT-ONLINE')] + [string] + ${To}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${Force}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${RetainPermissions}, + + [Parameter(ParameterSetName='Claims')] + [string] + ${SourceSkipList}, + + [Parameter(ParameterSetName='Claims')] + [string] + ${MapList}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${SkipSites}, + + [Parameter(ParameterSetName='Claims')] + [switch] + ${SkipPolicies}, + + [Parameter(ParameterSetName='Claims')] + [object] + ${Database}, + + [Parameter(ParameterSetName='Claims')] + [object] + ${TrustedProvider}, + + [Parameter(ParameterSetName='Claims')] + [guid] + ${SiteSubsriptionId}, + + [Parameter(ParameterSetName='Claims')] + [string] + ${LoggingDirectory}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPAccessServicesDatabaseCredentials { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${AppUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [string] + ${SourceServer}, + + [Parameter(Mandatory=$true)] + [string] + ${TargetServer}, + + [Parameter(Mandatory=$true)] + [System.Net.NetworkCredential] + ${ServerCredential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPActivitiesToWorkflowService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${WorkflowServiceAddress}, + + [string] + ${ActivityName}, + + [System.Net.ICredentials] + ${Credential}, + + [bool] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPBusinessDataCatalogAclToChildren { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${MetadataObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Source}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${TargetConnectionString}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPSideBySideFiles { + [CmdletBinding()] +param( + [string] + ${LogFile}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Copy-SPSite { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [object] + ${DestinationDatabase}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [string] + ${TargetUrl}, + + [string] + ${HostHeaderWebApplication}, + + [switch] + ${PreserveSiteId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPAppAutoProvision { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPBusinessDataCatalogEntity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPFeature { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Url}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPHealthAnalysisRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Url')] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPIPRangeAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPProjectActiveDirectoryEnterpriseResourcePoolSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPProjectEmailNotification { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPProjectEnterpriseProjectTaskSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPProjectQueueStatsMonitoring { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPSecureStoreMinDB { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ApplicationName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPSessionStateService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPSingleSignOn { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPUserLicensing { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPVideoStreaming { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPWebApplicationHttpThrottling { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disable-SPWebTemplateForSiteMaster { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${Template}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Disconnect-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Dismount-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Dismount-SPSiteMapDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [guid] + ${DatabaseId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Dismount-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPAppAutoProvision { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPBusinessDataCatalogEntity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPFeature { + [CmdletBinding(DefaultParameterSetName='FarmFeatureDefinition', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteFeature')] + [string] + ${Url}, + + [switch] + ${PassThru}, + + [switch] + ${Force}, + + [Parameter(ParameterSetName='FarmFeatureDefinition')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPHealthAnalysisRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('url')] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPIPRangeAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPProjectActiveDirectoryEnterpriseResourcePoolSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.IEnumerable[guid]] + ${GroupUids}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPProjectEmailNotification { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPProjectEnterpriseProjectTaskSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPProjectQueueStatsMonitoring { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPSecureStoreMinDB { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ApplicationName}, + + [ValidateNotNullOrEmpty()] + [guid] + ${SiteSubscriptionId}, + + [ValidateNotNullOrEmpty()] + [int] + ${PartitionLimit}, + + [ValidateNotNullOrEmpty()] + [int] + ${ThreadLimit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPSessionStateService { + [CmdletBinding(DefaultParameterSetName='AdvancedProvision', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultProvision', Mandatory=$true)] + [switch] + ${DefaultProvision}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='AdvancedProvision', Mandatory=$true)] + [string] + ${DatabaseName}, + + [System.Nullable[int]] + ${SessionTimeout}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPUserLicensing { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPVideoStreaming { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPWebApplicationHttpThrottling { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Enable-SPWebTemplateForSiteMaster { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${Template}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPAccessServicesDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPAppPackage { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPBusinessDataCatalogModel { + [CmdletBinding()] +param( + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [string] + ${SettingId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPInfoPathAdministrationFiles { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPMetadataWebServicePartitionData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [switch] + ${NoCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPPerformancePointContent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${ExportFileUrl}, + + [Parameter(Mandatory=$true)] + [array] + ${ItemUrls}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPSiteSubscriptionSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${AdminProperties}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPTagsAndNotesData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${FilePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Export-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeAlerts}, + + [object] + ${IncludeVersions}, + + [int] + ${CompressionSize}, + + [switch] + ${UseSqlSnapshot}, + + [string] + ${AppLogFilePath}, + + [string] + ${ItemUrl}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${IncludeUserSecurity}, + + [switch] + ${HaltOnWarning}, + + [switch] + ${HaltOnError}, + + [switch] + ${NoLogFile}, + + [switch] + ${NoFileCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabase { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${ContentDb}, + + [Parameter(Position=2, ValueFromPipeline=$true)] + [bool] + ${AccessAppsOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabaseServer { + [CmdletBinding(DefaultParameterSetName='GetDatabaseServersParameterSet')] +param( + [Parameter(ParameterSetName='GetDatabaseServersParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true)] + [Parameter(ParameterSetName='GetDatabaseServersParameterSet')] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='GetSingleDatabaseServerParamterSet', Mandatory=$true)] + [object] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabaseServerGroup { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${DatabaseServerGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAccessServicesDatabaseServerGroupMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAlternateURL { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [object] + ${Zone}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${ResourceName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppAcquisitionConfiguration { + [CmdletBinding(DefaultParameterSetName='MarketplaceSettingsInWebApplication')] +param( + [Parameter(ParameterSetName='MarketplaceSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='MarketplaceSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppAutoProvisionConnection { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [object] + ${ConnectionType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppDeniedEndpointList { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppDisablingConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppDomain { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppHostingQuotaConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppInstance { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='IdentityParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(ParameterSetName='WebParameterSet')] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(ParameterSetName='SiteAndIdParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ParameterSetName='SiteAndIdParameterSet', Mandatory=$true)] + [guid] + ${AppInstanceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppPrincipal { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NameIdentifier}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppScaleProfile { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppSiteSubscriptionName { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStateSyncLastRunTime { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStateUpdateInterval { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStoreConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAppStoreWebServiceConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAuthenticationProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, Position=2)] + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAuthenticationRealm { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPAzureVideoServiceAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${ServiceContext}, + + [Parameter(Position=2)] + [System.Net.ICredentials] + ${OAuth2BearerCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBackupHistory { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${Directory}, + + [switch] + ${ShowBackup}, + + [switch] + ${ShowRestore}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBingMapsBlock { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBingMapsKey { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBrowserCustomerExperienceImprovementProgram { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='Farm', Mandatory=$true)] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBusinessDataCatalogMetadataObject { + [CmdletBinding()] +param( + [string] + ${Namespace}, + + [string] + ${Name}, + + [string] + ${ContainingLobSystem}, + + [Parameter(Mandatory=$true)] + [object] + ${BdcObjectType}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPBusinessDataCatalogThrottleConfig { + [CmdletBinding(DefaultParameterSetName='ProxyProvided')] +param( + [Parameter(Mandatory=$true)] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [object] + ${ThrottleType}, + + [Parameter(ParameterSetName='ProxyProvided', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ParameterSetName='FileBackedProvided', Mandatory=$true)] + [switch] + ${FileBacked}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPCertificateAuthority { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPClaimProviderManager { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPClaimTypeEncoding { + [CmdletBinding()] +param( + [char] + ${EncodingCharacter}, + + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPConnectedServiceApplicationInformation { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet')] +param( + [Parameter(ParameterSetName='DefaultSet', Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='AllContentDatabasesInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDatabasesOfSite', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [switch] + ${ConnectAsUnattachedDatabase}, + + [Parameter(ParameterSetName='Unattached')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='Unattached', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='AllContentDatabasesInWebApplication')] + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${NoStatusFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPContentDeploymentJob { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [object] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPContentDeploymentPath { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPCustomLayoutsPage { + [CmdletBinding()] +param( + [object] + ${Identity}, + + [ValidateRange(14, 15)] + [int] + ${CompatibilityLevel}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultParameterSet')] +param( + [Parameter(ParameterSetName='DefaultParameterSet', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServerParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServerInstance}, + + [Parameter(ParameterSetName='NameParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDataConnectionFile { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDataConnectionFileDependent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='AllDeletedSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AllDeletedSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [string] + ${DateTimeFrom}, + + [string] + ${DateTimeTo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDesignerSettings { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDiagnosticConfig { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDiagnosticsPerformanceCounter { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ValueFromPipeline=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDiagnosticsProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPDistributedCacheClientSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchAdministrationComponent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchComponent { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [string] + ${Protocol}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlExtension { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlMapping { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchCrawlRule { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchFileFormat { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchHostController { + [CmdletBinding()] +param( + [object] + ${SearchServiceInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [object] + ${Type}, + + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchLinguisticComponentsStatus { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchLinksDatabase { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataCategory { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('p')] + [System.Nullable[guid]] + ${PropSet}, + + [Alias('vt')] + [Obsolete()] + [System.Nullable[int]] + ${VariantType}, + + [Alias('c')] + [object] + ${Category}, + + [string] + ${Limit}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [string] + ${Limit}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchMetadataMapping { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [object] + ${ManagedProperty}, + + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchOwner { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [Alias('l')] + [object] + ${Level}, + + [object] + ${SPWeb}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchPropertyRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${PropertyName}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Operator}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchPropertyRuleCollection { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAndSiteSettingsService { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAndSiteSettingsServiceProxy { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryAuthority { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryDemoted { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryKeyword { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryScope { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('u')] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [uri] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Alias('n')] + [object] + ${Scope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQuerySpellingCorrection { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchQuerySuggestionCandidates { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchRankingModel { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchResultItemType { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchResultSource { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchService { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceApplicationBackupStore { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${BackupFolder}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${Name}, + + [Parameter(Position=3, ValueFromPipeline=$true)] + [string] + ${BackupId}, + + [Parameter(Position=4)] + [switch] + ${UseMostRecent}, + + [Parameter(Position=5)] + [switch] + ${IsVerbose}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchServiceInstance { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchSiteHitRule { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchStatus { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [switch] + ${Primary}, + + [switch] + ${Text}, + + [switch] + ${Detailed}, + + [switch] + ${Constellation}, + + [switch] + ${JobStatus}, + + [switch] + ${HealthReport}, + + [switch] + ${DetailSearchRuntime}, + + [string] + ${Component}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchTopology { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [switch] + ${Active}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPEnterpriseSearchVssDataPath { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPFarm { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPFarmConfig { + [CmdletBinding()] +param( + [switch] + ${ServiceConnectionPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPFeature { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='FarmFeatures')] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='SiteFeatures')] + [object] + ${Site}, + + [Parameter(ParameterSetName='WebFeatures')] + [object] + ${Web}, + + [Parameter(ParameterSetName='WebApplicationFeatures')] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteFeatures')] + [switch] + ${Sandboxed}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='FarmFeatureDefinitions')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPHealthAnalysisRule { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(ParameterSetName='SpecificRule', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPHelpCollection { + [CmdletBinding()] +param( + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathFormsService { + [CmdletBinding()] +param( + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathFormTemplate { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathUserAgent { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInfoPathWebServiceProxy { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInsightsAuthSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInternalAppStateSyncLastRunTime { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPInternalAppStateUpdateInterval { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPIPRangeAllowList { + [CmdletBinding(DefaultParameterSetName='CustomIPAllowList', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='CustomIPAllowList', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteName}, + + [Parameter(ParameterSetName='InternalIPAllowList', Mandatory=$true)] + [switch] + ${InternalIPAllowList}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPIRMSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPLogEvent { + [CmdletBinding(DefaultParameterSetName='Directory')] +param( + [Parameter(ParameterSetName='Directory')] + [ValidateNotNullOrEmpty()] + [string] + ${Directory}, + + [Parameter(ParameterSetName='File')] + [ValidateNotNullOrEmpty()] + [string] + ${File}, + + [switch] + ${AsString}, + + [ValidateNotNullOrEmpty()] + [string[]] + ${ContextKey}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [ValidateNotNullOrEmpty()] + [string] + ${MinimumLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPLogLevel { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Service')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Service', ValueFromPipeline=$true)] + [object] + ${Service}, + + [Parameter(ParameterSetName='WebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='Server', ValueFromPipeline=$true)] + [object] + ${Server}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication')] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMetadataServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMetadataServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMicrofeedOptions { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPMobileMessagingAccount { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [Alias('ServiceType','AccountType')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPO365LinkSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPODataConnectionSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [ValidateNotNull()] + [ValidateLength(0, 246)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPODataConnectionSettingMetadata { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateLength(0, 255)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPOfficeStoreAppsDefaultActivation { + [CmdletBinding(DefaultParameterSetName='AppsForOfficeSettingsInWebApplication')] +param( + [Parameter(ParameterSetName='AppsForOfficeSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPendingUpgradeActions { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${RootObject}, + + [switch] + ${Recursive}, + + [switch] + ${SkipSiteUpgradeActionInfo}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPPluggableSecurityTrimmer { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProcessAccount { + [CmdletBinding(DefaultParameterSetName='NetworkService')] +param( + [Parameter(ParameterSetName='NetworkService')] + [switch] + ${NetworkService}, + + [Parameter(ParameterSetName='LocalSystem')] + [switch] + ${LocalSystem}, + + [Parameter(ParameterSetName='LocalService')] + [switch] + ${LocalService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProduct { + [CmdletBinding(DefaultParameterSetName='Local')] +param( + [Parameter(ParameterSetName='Server', ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Server}, + + [Parameter(ParameterSetName='Local')] + [switch] + ${Local}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProfileLeader { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProfileServiceApplicationSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [ValidateSet('UserACL','MySiteReaderACL')] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectDatabaseQuota { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectDatabaseUsage { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectEnterpriseProjectTaskSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectEventServiceSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectIsEmailNotificationEnabled { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectOdataConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectPCSSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectPermissionMode { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectQueueSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPProjectWebInstance { + [CmdletBinding()] +param( + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRequestManagementSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${Availability}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPRuntimeTelemetry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabaseDataState { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabaseInconsistency { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPScaleOutDatabaseLogEntry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [int] + ${Count}, + + [object] + ${MajorAction}, + + [System.Nullable[guid]] + ${CorrelationId}, + + [byte[]] + ${RangeLimitPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSecureStoreApplication { + [CmdletBinding(DefaultParameterSetName='NameSet')] +param( + [Parameter(ParameterSetName='AllSet', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ParameterSetName='NameSet', Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSecureStoreSystemAccount { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSecurityTokenServiceConfig { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabaseDataState { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabaseInconsistency { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServerScaleOutDatabaseLogEntry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [int] + ${Count}, + + [object] + ${MajorAction}, + + [System.Nullable[guid]] + ${CorrelationId}, + + [byte[]] + ${RangeLimitPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPService { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationEndpoint { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Name', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Name')] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationPool { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationProxyGroup { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default identity', Mandatory=$true)] + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceApplicationSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Admin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceContext { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='Site', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceHostConfig { + [CmdletBinding()] +param( + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPServiceInstance { + [CmdletBinding(DefaultParameterSetName='Identity')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Server', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Server}, + + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSessionStateService { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPShellAdmin { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSite { + [CmdletBinding(DefaultParameterSetName='AllSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AllSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='AllSitesInContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='AllSitesInContentDB')] + [switch] + ${NeedsB2BUpgrade}, + + [Parameter(ParameterSetName='AllSitesInWebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AllSitesInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='AllSitesInIdentity')] + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteAdministration { + [CmdletBinding(DefaultParameterSetName='AllSitesInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AllSitesInIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Limit}, + + [Parameter(ParameterSetName='AllSitesInContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='AllSitesInWebApplication', ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AllSitesInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='AllSitesInIdentity')] + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteMapDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteMaster { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscription { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionConfig { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionEdiscoveryHub { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionEdiscoverySearchScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionFeaturePack { + [CmdletBinding(DefaultParameterSetName='FeaturePack')] +param( + [Parameter(ParameterSetName='FeaturePack', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteSubscription', ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionIRMConfig { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteSubscriptionMetadataConfig { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteUpgradeSessionInfo { + [CmdletBinding(DefaultParameterSetName='ContentDB')] +param( + [Parameter(ParameterSetName='Site', Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ParameterSetName='ContentDB', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='ContentDB')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${HideWaiting}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowInProgress}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowCompleted}, + + [Parameter(ParameterSetName='ContentDB')] + [switch] + ${ShowFailed}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPSolution { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPStateServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPStateServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPStateServiceDatabase { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Default', Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServiceApplication', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Application')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTaxonomySession { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${RequestManagementSettings}, + + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTimerJob { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTopologyServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTopologyServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTranslationThrottlingSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [object] + ${Farm}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedIdentityTokenIssuer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedRootAuthority { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedSecurityTokenIssuer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPTrustedServiceTokenIssuer { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUpgradeActions { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUsageApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUsageDefinition { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUsageService { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUser { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [object] + ${Group}, + + [string] + ${Limit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserLicense { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserLicenseMapping { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserLicensing { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserSettingsProvider { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserSettingsProviderManager { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPUserSolution { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVideoStreamingConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioExternalData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioPerformance { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [string] + ${DataProviderId}, + + [int] + ${DataProviderType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioServiceApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPVisioServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Site}, + + [string] + ${Limit}, + + [switch] + ${Regex}, + + [scriptblock] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebApplication { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeCentralAdministration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebApplicationAppDomain { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${AppDomain}, + + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebApplicationHttpThrottlingMonitor { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebPartPack { + [CmdletBinding()] +param( + [Parameter(Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [switch] + ${GlobalOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebTemplate { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [uint32] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWebTemplatesEnabledForSiteMaster { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWOPIBinding { + [CmdletBinding()] +param( + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Server}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WOPIZone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWOPISuppressionSetting { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWOPIZone { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWorkflowConfig { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Get-SPWorkflowServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Grant-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Right}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Grant-SPObjectSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNull()] + [string[]] + ${Rights}, + + [switch] + ${Replace}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPAccessServicesDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [byte[]] + ${Bacpac}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPAppPackage { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [object] + ${Source}, + + [string] + ${AssetId}, + + [string] + ${ContentMarket}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPBusinessDataCatalogDotNetAssembly { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [ValidateNotNullOrEmpty()] + [string[]] + ${DependentAssemblyPaths}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${LobSystem}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPBusinessDataCatalogModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ParameterSetName='Catalog', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${Force}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchCustomExtractionDictionary { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the UNC path to the CSV file.')] + [string] + ${FileName}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the fully qualified name of the target dictionary to be deployed.')] + [ValidateSet('Microsoft.UserDictionaries.EntityExtraction.Custom.Word.1','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.2','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.3','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.4','Microsoft.UserDictionaries.EntityExtraction.Custom.Word.5','Microsoft.UserDictionaries.EntityExtraction.Custom.ExactWord.1','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.1','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.2','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.3','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.4','Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.5','Microsoft.UserDictionaries.EntityExtraction.Custom.ExactWordPart.1')] + [string] + ${DictionaryName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchPopularQueries { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [object] + ${ResultSource}, + + [Parameter(Mandatory=$true)] + [object] + ${Web}, + + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchThesaurus { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, HelpMessage='Specify the UNC path to the CSV file.')] + [string] + ${FileName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Filename}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPInfoPathAdministrationFiles { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPMetadataWebServicePartitionData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [switch] + ${ToServiceDatabase}, + + [ValidateNotNull()] + [object] + ${ToContentDatabase}, + + [switch] + ${NoCompression}, + + [ValidateSet('true','false')] + [switch] + ${OverwriteExisting}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPPerformancePointContent { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${ImportFileUrl}, + + [Parameter(Mandatory=$true)] + [string] + ${MasterPageUrl}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteDestination}, + + [Parameter(Mandatory=$true)] + [hashtable] + ${LocationMap}, + + [Parameter(Mandatory=$true)] + [hashtable] + ${DatasourceMap}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPServerScaleOutDatabaseTenantData { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${FilePath}, + + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [switch] + ${ModelsIncluded}, + + [switch] + ${LocalizedNamesIncluded}, + + [switch] + ${PropertiesIncluded}, + + [switch] + ${ProxiesIncluded}, + + [switch] + ${PermissionsIncluded}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPSiteSubscriptionSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Path}, + + [switch] + ${AdminProperties}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Import-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${IncludeUserCustomAction}, + + [switch] + ${ActivateSolutions}, + + [object] + ${UpdateVersions}, + + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Force}, + + [switch] + ${IncludeUserSecurity}, + + [switch] + ${HaltOnWarning}, + + [switch] + ${HaltOnError}, + + [switch] + ${NoLogFile}, + + [switch] + ${NoFileCompression}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Initialize-SPResourceSecurity { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Initialize-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPApp { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPApplicationContent { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebAccessible}, + + [switch] + ${Overwrite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPFeature { + [CmdletBinding(DefaultParameterSetName='PathSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='PathSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [Parameter(ParameterSetName='AllExistingFeatures', Mandatory=$true)] + [switch] + ${AllExistingFeatures}, + + [Parameter(ParameterSetName='ScanForFeatures', Mandatory=$true)] + [switch] + ${ScanForFeatures}, + + [switch] + ${Force}, + + [Parameter(ParameterSetName='ScanForFeatures')] + [Parameter(ParameterSetName='AllExistingFeatures')] + [string] + ${SolutionId}, + + [Parameter(ParameterSetName='PathSet')] + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPHelpCollection { + [CmdletBinding(DefaultParameterSetName='InstallOne')] +param( + [Parameter(ParameterSetName='InstallOne', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${LiteralPath}, + + [Parameter(ParameterSetName='InstallAll', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [switch] + ${EnableGradualUpgrade}, + + [switch] + ${NoWait}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPService { + [CmdletBinding()] +param( + [switch] + ${Provision}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPSolution { + [CmdletBinding(DefaultParameterSetName='Deploy', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Synchronize', Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Deploy', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Deploy')] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='Deploy')] + [string] + ${Time}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${CASPolicies}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${GACDeployment}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${FullTrustBinDeployment}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${Local}, + + [uint32] + ${Language}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${Force}, + + [Parameter(ParameterSetName='Deploy')] + [switch] + ${AllWebApplications}, + + [Parameter(ParameterSetName='Deploy')] + [string] + ${CompatibilityLevel}, + + [Parameter(ParameterSetName='Synchronize', Mandatory=$true)] + [switch] + ${Synchronize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Install-SPWebPartPack { + [CmdletBinding(DefaultParameterSetName='UseFileName', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='UseName', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='UseFileName', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${LiteralPath}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [switch] + ${GlobalInstall}, + + [uint32] + ${Language}, + + [switch] + ${Force}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Invoke-SPProjectActiveDirectoryEnterpriseResourcePoolSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Invoke-SPProjectActiveDirectoryGroupSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Merge-SPLogFile { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${Path}, + + [switch] + ${Overwrite}, + + [datetime] + ${StartTime}, + + [datetime] + ${EndTime}, + + [string[]] + ${Process}, + + [uint32[]] + ${ThreadID}, + + [string[]] + ${Area}, + + [string[]] + ${Category}, + + [string[]] + ${EventID}, + + [string] + ${Level}, + + [string[]] + ${Message}, + + [guid[]] + ${Correlation}, + + [string[]] + ${ContextFilter}, + + [switch] + ${ExcludeNestedCorrelation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Migrate-SPDatabase { + [CmdletBinding(DefaultParameterSetName='SiteSubscription', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, Position=1)] + [object] + ${DestinationDatabase}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=2)] + [object] + ${SiteCollection}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true, Position=2)] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=3)] + [object] + ${ServiceType}, + + [Parameter(Position=4)] + [switch] + ${Overwrite}, + + [Parameter(Position=5)] + [switch] + ${UseLinkedSqlServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Migrate-SPProjectDatabase { + [CmdletBinding(DefaultParameterSetName='web', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='web', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='web')] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='web')] + [ValidateNotNullOrEmpty()] + [string] + ${FailoverPartner}, + + [Parameter(ParameterSetName='web')] + [pscredential] + ${SQLLogon}, + + [Parameter(ParameterSetName='web')] + [switch] + ${Overwrite}, + + [Parameter(ParameterSetName='web', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Migrate-SPProjectResourcePlans { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Mount-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${SkipIntegrityChecks}, + + [switch] + ${NoB2BSiteUpgrade}, + + [string] + ${DatabaseFailoverServer}, + + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseAccessCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${ClearChangeLog}, + + [switch] + ${ChangeSyncKnowledge}, + + [switch] + ${AssignNewDatabaseId}, + + [switch] + ${UseLatestSchema}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Mount-SPSiteMapDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseFailoverServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Mount-SPStateServiceDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Weight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPAppManagementData { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [object] + ${SourceAppManagementDatabase}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [object] + ${TargetContentDatabase}, + + [Parameter(ParameterSetName='Default', Mandatory=$true)] + [guid] + ${SiteSubscriptionId}, + + [Parameter(ParameterSetName='Default')] + [switch] + ${OverWrite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPBlobStorageLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${SourceDatabase}, + + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDataSourceInstance}, + + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDatabase}, + + [ValidateNotNullOrEmpty()] + [string] + ${Dir}, + + [ValidateNotNullOrEmpty()] + [bool] + ${VerboseMod}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${DestinationDatabase}, + + [hashtable] + ${RbsProviderMapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPEnterpriseSearchLinksDatabases { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=1)] + [System.Nullable[guid]] + ${RepartitioningId}, + + [Parameter(Position=2)] + [object] + ${SourceStores}, + + [Parameter(Position=3)] + [object] + ${TargetStores}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPProfileManagedMetadataProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Identity}, + + [string] + ${TermSetName}, + + [switch] + ${AvailableForTagging}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPSecureStorePartitionData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${SourceFarmPassphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${TargetFarmPassphrase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${DestinationDatabase}, + + [hashtable] + ${RbsProviderMapping}, + + [bool] + ${CopyEvents}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPSocialComment { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [string] + ${OldUrl}, + + [string] + ${NewUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Move-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewAlias}, + + [switch] + ${IgnoreSID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [string] + ${Name}, + + [switch] + ${Default}, + + [ValidateRange(1, 255)] + [int] + ${ColumnsMax}, + + [ValidateRange(1, 200000)] + [int] + ${RowsMax}, + + [ValidateRange(1, 20)] + [int] + ${SourcesMax}, + + [ValidateRange(0, 32)] + [int] + ${OutputCalculatedColumnsMax}, + + [ValidateRange(0, 8)] + [int] + ${OrderByMax}, + + [switch] + ${OuterJoinsAllowed}, + + [switch] + ${NonRemotableQueriesAllowed}, + + [ValidateRange(-1, 2147483647)] + [int] + ${RecordsInTableMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${ApplicationLogSizeMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(0, 4096)] + [int] + ${SessionMemoryMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${TemplateSizeMax}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServicesApplication { + [CmdletBinding(DefaultParameterSetName='NoApplicationServerParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateNotNull()] + [pscredential] + ${DatabaseServerCredentials}, + + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='NoApplicationServerParameterSet', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [string] + ${Name}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [switch] + ${Default}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [ValidateRange(-1, 2073600)] + [int] + ${QueryTimeout}, + + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [ValidateRange(-1, 1440)] + [int] + ${RecoveryPointObjective}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [Parameter(ParameterSetName='NoApplicationServerParameterSet')] + [bool] + ${Hosted}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${Encrypt}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${TrustServerCertificate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServicesApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${application}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAccessServicesDatabaseServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServerGroupName}, + + [ValidateNotNullOrEmpty()] + [guid] + ${ServerReferenceId}, + + [ValidateNotNullOrEmpty()] + [pscredential] + ${DatabaseServerCredentials}, + + [ValidateNotNullOrEmpty()] + [bool] + ${AvailableForCreate}, + + [ValidateNotNullOrEmpty()] + [bool] + ${Exclusive}, + + [bool] + ${Encrypt}, + + [bool] + ${TrustServerCertificate}, + + [bool] + ${ValidateServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${SecondaryDatabaseServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${UserDomain}, + + [object] + ${LoginType}, + + [object] + ${State}, + + [object] + ${StateOwner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAlternateURL { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [object] + ${Zone}, + + [switch] + ${Internal}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ResourceName', Mandatory=$true)] + [string] + ${ResourceName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAppManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAppManagementServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [switch] + ${UseDefaultProxyGroup}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Uri}, + + [Parameter(ParameterSetName='ServiceApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAuthenticationProvider { + [CmdletBinding(DefaultParameterSetName='Windows')] +param( + [Parameter(ParameterSetName='Windows')] + [switch] + ${AllowAnonymous}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${UseBasicAuthentication}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${DisableKerberos}, + + [Parameter(ParameterSetName='Windows')] + [switch] + ${UseWindowsIntegratedAuthentication}, + + [Parameter(ParameterSetName='Forms', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ASPNETMembershipProvider}, + + [Parameter(ParameterSetName='Forms', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ASPNETRoleProviderName}, + + [Parameter(ParameterSetName='Trusted', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAzureAccessControlServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${MetadataServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPAzureVideoServiceAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true, Position=2)] + [uri] + ${GlobalLocatorServiceUri}, + + [Parameter(Mandatory=$true, Position=3)] + [string] + ${Region}, + + [Parameter(Position=4)] + [System.Net.ICredentials] + ${OAuth2BearerCredentials}, + + [Parameter(Position=5)] + [switch] + ${SkipCheckAccountExistence}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPBECWebServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPBusinessDataCatalogServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [switch] + ${Sharing}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPBusinessDataCatalogServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [switch] + ${DefaultProxyGroup}, + + [string] + ${Name}, + + [Parameter(ParameterSetName='PipeBind', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri')] + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPCentralAdministration { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [int] + ${Port}, + + [Parameter(Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${WindowsAuthProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${DisplayName}, + + [Parameter(Mandatory=$true)] + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [string] + ${AssemblyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Type}, + + [switch] + ${Enabled}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimsPrincipal { + [CmdletBinding(DefaultParameterSetName='IdentityType')] +param( + [Parameter(ParameterSetName='IdentityType', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ParameterSetName='STSIdentity', Mandatory=$true, Position=2)] + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ParameterSetName='IdentityType', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${IdentityType}, + + [Parameter(ParameterSetName='BasicClaim', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${EncodedClaim}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='STSIdentity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimValue}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='STSIdentity', Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ParameterSetName='ClaimProvider', Mandatory=$true, Position=2)] + [ValidateNotNull()] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='STSIdentity', Position=3)] + [ValidateNotNull()] + [switch] + ${IdentifierClaim}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimTypeEncoding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [char] + ${EncodingCharacter}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPClaimTypeMapping { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${IncomingClaimType}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [string] + ${IncomingClaimTypeDisplayName}, + + [Parameter(Position=2)] + [ValidateNotNullOrEmpty()] + [string] + ${LocalClaimType}, + + [ValidateNotNull()] + [switch] + ${SameAsIncoming}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPConfigurationDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseName}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(Position=2, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DirectoryDomain}, + + [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DirectoryOrganizationUnit}, + + [Parameter(Position=4, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${AdministrationContentDatabaseName}, + + [Parameter(Position=5, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(Mandatory=$true, Position=6, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${FarmCredentials}, + + [Parameter(Mandatory=$true, Position=7, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [securestring] + ${Passphrase}, + + [Parameter(Position=8, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${SkipRegisterAsDistributedCacheHost}, + + [Parameter(Position=9, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteMapDatabaseName}, + + [Parameter(Position=10, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteMapDatabaseServer}, + + [Parameter(Position=11, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseFailOverServer}, + + [object] + ${LocalServerRole}, + + [switch] + ${ServerRoleOptional}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseAccessCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${ClearChangeLog}, + + [switch] + ${ChangeSyncKnowledge}, + + [switch] + ${AssignNewDatabaseId}, + + [switch] + ${UseLatestSchema}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [object] + ${SPContentDeploymentPath}, + + [object] + ${Scope}, + + [string] + ${Schedule}, + + [switch] + ${ScheduleEnabled}, + + [switch] + ${IncrementalEnabled}, + + [object] + ${SqlSnapshotSetting}, + + [switch] + ${HostingSupportEnabled}, + + [object] + ${EmailNotifications}, + + [string[]] + ${EmailAddresses}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceSPWebApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceSPSite}, + + [Parameter(Mandatory=$true)] + [uri] + ${DestinationCentralAdministrationURL}, + + [Parameter(Mandatory=$true)] + [uri] + ${DestinationSPWebApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DestinationSPSite}, + + [object] + ${Authentication}, + + [Parameter(Mandatory=$true)] + [pscredential] + ${PathAccount}, + + [switch] + ${DeployUserNamesEnabled}, + + [object] + ${DeploySecurityInformation}, + + [switch] + ${EventReceiversEnabled}, + + [switch] + ${CompressionEnabled}, + + [switch] + ${PathEnabled}, + + [object] + ${KeepTemporaryFilesOptions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchAdminComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchAnalyticsProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchContentProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [object] + ${Type}, + + [string] + ${Tag}, + + [Alias('s')] + [string] + ${StartAddresses}, + + [Alias('p')] + [object] + ${CrawlPriority}, + + [System.Nullable[int]] + ${MaxPageEnumerationDepth}, + + [System.Nullable[int]] + ${MaxSiteEnumerationDepth}, + + [object] + ${SharePointCrawlBehavior}, + + [object] + ${BDCApplicationProxyGroup}, + + [string[]] + ${LOBSystemSet}, + + [string] + ${CustomProtocol}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${Protocol}, + + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [string] + ${ModelFilePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [string] + ${Target}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Path}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [object] + ${Type}, + + [System.Nullable[bool]] + ${IsAdvancedRegularExpression}, + + [System.Nullable[bool]] + ${CrawlAsHttp}, + + [System.Nullable[bool]] + ${FollowComplexUrls}, + + [System.Nullable[int]] + ${PluggableSecurityTimmerId}, + + [System.Nullable[bool]] + ${SuppressIndexing}, + + [System.Nullable[int]] + ${Priority}, + + [string] + ${ContentClass}, + + [object] + ${AuthenticationType}, + + [string] + ${AccountName}, + + [securestring] + ${AccountPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchFileFormat { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0)] + [string] + ${FormatId}, + + [Parameter(Mandatory=$true, Position=1)] + [string] + ${FormatName}, + + [Parameter(Mandatory=$true, Position=2)] + [string] + ${MimeType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchIndexComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [uint32] + ${IndexPartition}, + + [string] + ${RootDirectory}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(Mandatory=$true)] + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('p')] + [System.Nullable[guid]] + ${PropSet}, + + [Alias('d')] + [System.Nullable[bool]] + ${DiscoverNewProperties}, + + [Alias('m')] + [System.Nullable[bool]] + ${MapToContents}, + + [Alias('auto')] + [System.Nullable[bool]] + ${AutoCreateNewManagedProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('c')] + [object] + ${Category}, + + [Parameter(Mandatory=$true)] + [Alias('ie')] + [bool] + ${IsNameEnum}, + + [Parameter(Mandatory=$true)] + [Alias('vt')] + [Obsolete()] + [int] + ${VariantType}, + + [Parameter(Mandatory=$true)] + [Alias('p')] + [guid] + ${PropSet}, + + [Alias('im')] + [System.Nullable[bool]] + ${IsMappedToContents}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('t')] + [int] + ${Type}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('f')] + [System.Nullable[bool]] + ${FullTextQueriable}, + + [Alias('r')] + [System.Nullable[bool]] + ${Retrievable}, + + [Alias('q')] + [System.Nullable[bool]] + ${Queryable}, + + [Alias('e')] + [System.Nullable[bool]] + ${EnabledForScoping}, + + [Alias('nn')] + [System.Nullable[bool]] + ${NameNormalized}, + + [Alias('rp')] + [System.Nullable[bool]] + ${RespectPriority}, + + [Alias('rd')] + [System.Nullable[bool]] + ${RemoveDuplicates}, + + [Alias('im5')] + [Obsolete('This property is replaced by IncludeInAlertSignature.')] + [System.Nullable[bool]] + ${IncludeInMd5}, + + [Alias('sfa')] + [System.Nullable[bool]] + ${SafeForAnonymous}, + + [Alias('ia')] + [System.Nullable[bool]] + ${IncludeInAlertSignature}, + + [Alias('nw')] + [System.Nullable[bool]] + ${NoWordBreaker}, + + [Alias('u')] + [System.Nullable[int16]] + ${UserFlags}, + + [Alias('qir')] + [System.Nullable[bool]] + ${EnabledForQueryIndependentRank}, + + [Alias('def')] + [System.Nullable[uint32]] + ${DefaultForQueryIndependentRank}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${ManagedProperty}, + + [Parameter(Mandatory=$true)] + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('l')] + [float] + ${Level}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryDemoted { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Term}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Alias('d')] + [string] + ${Definition}, + + [Alias('c')] + [string] + ${Contact}, + + [Alias('s')] + [System.Nullable[datetime]] + ${StartDate}, + + [Alias('e')] + [System.Nullable[datetime]] + ${EndDate}, + + [Alias('r')] + [System.Nullable[datetime]] + ${ReviewDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryProcessingComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchTopology}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchServiceInstance}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('d')] + [string] + ${Description}, + + [Alias('o')] + [uri] + ${OwningSiteUrl}, + + [Alias('a')] + [string] + ${AlternateResultsPage}, + + [Parameter(Mandatory=$true)] + [Alias('disp')] + [System.Nullable[bool]] + ${DisplayInAdminUI}, + + [Alias('type')] + [System.Nullable[int]] + ${CompilationType}, + + [Alias('f')] + [string] + ${ExtendedSearchFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [Alias('s')] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [Alias('type')] + [string] + ${RuleType}, + + [Alias('f')] + [string] + ${FilterBehavior}, + + [Alias('ut')] + [string] + ${UrlScopeRuleType}, + + [Alias('text')] + [string] + ${MatchingString}, + + [Alias('value')] + [string] + ${PropertyValue}, + + [Alias('mname')] + [object] + ${ManagedProperty}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${RankingModelXML}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchResultItemType { + [CmdletBinding(DefaultParameterSetName='New', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(ParameterSetName='New', Mandatory=$true, Position=1)] + [Parameter(ParameterSetName='Copy', Position=1)] + [Alias('n')] + [string] + ${Name}, + + [Parameter(ParameterSetName='New', Mandatory=$true, Position=2)] + [Parameter(ParameterSetName='Copy', Position=2)] + [Alias('rule')] + [object] + ${Rules}, + + [Parameter(Position=3)] + [Alias('priority')] + [int] + ${RulePriority}, + + [Parameter(Position=4)] + [Alias('dp')] + [string] + ${DisplayProperties}, + + [Parameter(Position=5)] + [Alias('sid')] + [System.Nullable[guid]] + ${SourceID}, + + [Parameter(ParameterSetName='New', Mandatory=$true, Position=6)] + [Parameter(ParameterSetName='Copy', Position=6)] + [Alias('url')] + [string] + ${DisplayTemplateUrl}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ParameterSetName='Copy', Mandatory=$true)] + [Alias('copy')] + [object] + ${ExistingResultItemType}, + + [Parameter(ParameterSetName='Copy', Mandatory=$true)] + [Alias('eo')] + [object] + ${ExistingResultItemTypeOwner}, + + [Alias('opt')] + [System.Nullable[bool]] + ${OptimizeForFrequentUse}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [string] + ${Description}, + + [string] + ${QueryTemplate}, + + [Parameter(Mandatory=$true)] + [guid] + ${ProviderId}, + + [string] + ${RemoteUrl}, + + [System.Nullable[bool]] + ${AutoDiscover}, + + [object] + ${AuthenticationType}, + + [string] + ${UserName}, + + [string] + ${Password}, + + [string] + ${SsoId}, + + [System.Nullable[bool]] + ${MakeDefault}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [int] + ${Id}, + + [Parameter(Mandatory=$true)] + [string] + ${TypeName}, + + [string] + ${Properties}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [string] + ${RulePath}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='DefaultParameterSet', Position=0)] + [Parameter(ParameterSetName='DatabasePlacement', Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='DatabasePlacement')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [switch] + ${Partitioned}, + + [Parameter(ParameterSetName='DefaultParameterSet', Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='DefaultParameterSet')] + [object] + ${AdminApplicationPool}, + + [Parameter(ParameterSetName='DatabasePlacement', Mandatory=$true)] + [hashtable] + ${ParametersForDatabases}, + + [Parameter(ParameterSetName='DatabasePlacement')] + [Parameter(ParameterSetName='DefaultParameterSet')] + [bool] + ${CloudIndex}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='SSA', Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [string] + ${Uri}, + + [switch] + ${Partitioned}, + + [switch] + ${MergeWithDefaultPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchSiteHitRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchService}, + + [Parameter(Mandatory=$true)] + [string] + ${HitRate}, + + [Parameter(Mandatory=$true)] + [string] + ${Behavior}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='Clone')] + [switch] + ${Clone}, + + [Parameter(ParameterSetName='Clone')] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPLogFile { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPManagedAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [pscredential] + ${Credential}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${RelativeURL}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [switch] + ${Explicit}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPMarketplaceWebServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceEndpointUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPMetadataServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${AdministratorAccount}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${FullAccessAccount}, + + [string] + ${HubUri}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='Quota', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [string] + ${ReadAccessAccount}, + + [string] + ${RestrictedAccount}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [int] + ${CacheTimeCheckInterval}, + + [int] + ${MaxChannelCache}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true)] + [switch] + ${DisablePartitionQuota}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${GroupsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermSetsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${LabelsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${PropertiesPerPartition}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPMetadataServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${ContentTypePushdownEnabled}, + + [switch] + ${ContentTypeSyndicationEnabled}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${DefaultKeywordTaxonomy}, + + [switch] + ${DefaultSiteCollectionTaxonomy}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [object] + ${ServiceApplication}, + + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPODataConnectionSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 246)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${ServiceAddressURL}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [string] + ${ExtensionProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPOnlineApplicationPrincipalManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${OnlineTenantUri}, + + [ValidateNotNull()] + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateLength(0, 64)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [bool] + ${CommentsDisabled}, + + [int] + ${CommentsScorecardMax}, + + [int] + ${IndicatorImageCacheSeconds}, + + [int] + ${DataSourceQueryTimeoutSeconds}, + + [int] + ${FilterRememberUserSelectionsDays}, + + [int] + ${FilterTreeMembersMax}, + + [int] + ${FilterSearchResultsMax}, + + [int] + ${ShowDetailsInitialRows}, + + [bool] + ${ShowDetailsMaxRowsDisabled}, + + [int] + ${ShowDetailsMaxRows}, + + [bool] + ${MSMQEnabled}, + + [string] + ${MSMQName}, + + [int] + ${SessionHistoryHours}, + + [bool] + ${AnalyticQueryLoggingEnabled}, + + [bool] + ${TrustedDataSourceLocationsRestricted}, + + [bool] + ${TrustedContentLocationsRestricted}, + + [int] + ${SelectMeasureMaximum}, + + [int] + ${DecompositionTreeMaximum}, + + [bool] + ${ApplicationProxyCacheEnabled}, + + [bool] + ${ApplicationCacheEnabled}, + + [int] + ${ApplicationCacheMinimumHitCount}, + + [int] + ${AnalyticResultCacheMinimumHitCount}, + + [int] + ${ElementCacheSeconds}, + + [int] + ${AnalyticQueryCellMax}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseFailoverServer}, + + [pscredential] + ${DatabaseSQLAuthenticationCredential}, + + [bool] + ${UseEffectiveUserName}, + + [string] + ${DataSourceUnattendedServiceAccountTargetApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPerformancePointServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateLength(0, 64)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateLength(0, 1024)] + [string] + ${Url}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(Mandatory=$true)] + [object] + ${TrustedLocationType}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPowerPointConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 128)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPPowerPointConversionServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 128)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${AddToDefaultGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [string] + ${ProfileDBName}, + + [string] + ${ProfileDBServer}, + + [pscredential] + ${ProfileDBCredentials}, + + [string] + ${ProfileDBFailoverServer}, + + [string] + ${SocialDBName}, + + [string] + ${SocialDBServer}, + + [pscredential] + ${SocialDBCredentials}, + + [string] + ${SocialDBFailoverServer}, + + [string] + ${ProfileSyncDBName}, + + [string] + ${ProfileSyncDBServer}, + + [pscredential] + ${ProfileSyncDBCredentials}, + + [string] + ${ProfileSyncDBFailoverServer}, + + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPProfileServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [string] + ${Name}, + + [Parameter(ParameterSetName='Application', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPProjectServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ApplicationPool}, + + [switch] + ${Proxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPProjectServiceApplicationProxy { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPRequestManagementRuleCriteria { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='CustomPropertyParameterSet', Mandatory=$true, Position=0)] + [Parameter(ParameterSetName='StandardParameterSet', Mandatory=$true, Position=0)] + [string] + ${Value}, + + [Parameter(ParameterSetName='CustomPropertyParameterSet', Mandatory=$true, Position=1)] + [string] + ${CustomHeader}, + + [Parameter(ParameterSetName='StandardParameterSet', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Property}, + + [Parameter(ParameterSetName='CustomPropertyParameterSet', Position=2)] + [Parameter(ParameterSetName='StandardParameterSet', Position=2)] + [ValidateNotNull()] + [object] + ${MatchType}, + + [Parameter(ParameterSetName='StandardParameterSet', Position=2)] + [Parameter(ParameterSetName='CustomPropertyParameterSet', Position=2)] + [System.Nullable[switch]] + ${CaseSensitive}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreApplication { + [CmdletBinding()] +param( + [object] + ${Administrator}, + + [object] + ${CredentialsOwnerGroup}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Fields}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(Mandatory=$true)] + [object] + ${TargetApplication}, + + [object] + ${TicketRedeemer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreApplicationField { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [switch] + ${Masked}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [object] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='MinDBSet', Mandatory=$true)] + [Parameter(ParameterSetName='NoMinDBSet', Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='MinDBSet', Mandatory=$true)] + [Parameter(ParameterSetName='NoMinDBSet', Mandatory=$true)] + [switch] + ${AuditingEnabled}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [Parameter(ParameterSetName='MinDBSet')] + [System.Nullable[int]] + ${AuditlogMaxSize}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='MinDBSet')] + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${Name}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [Parameter(ParameterSetName='MinDBSet')] + [switch] + ${PartitionMode}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [Parameter(ParameterSetName='MinDBSet')] + [switch] + ${Sharing}, + + [Parameter(ParameterSetName='MinDBSet')] + [Parameter(ParameterSetName='NoMinDBSet')] + [switch] + ${DeferUpgradeActions}, + + [Parameter(ParameterSetName='MinDBSet', Mandatory=$true)] + [switch] + ${EnableMinDB}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${DefaultProxyGroup}, + + [string] + ${Name}, + + [Parameter(ParameterSetName='PipeBind', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSecureStoreTargetApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${ApplicationType}, + + [string] + ${ContactEmail}, + + [Parameter(Mandatory=$true)] + [string] + ${FriendlyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${SetCredentialsUri}, + + [int] + ${TimeoutInMinutes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateLength(1, 100)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${Account}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPServiceApplicationProxyGroup { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [AllowEmptyString()] + [ValidateLength(0, 100)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [uint32] + ${Language}, + + [object] + ${Template}, + + [string] + ${Name}, + + [string] + ${Description}, + + [object] + ${QuotaTemplate}, + + [string] + ${OwnerEmail}, + + [Parameter(Mandatory=$true)] + [object] + ${OwnerAlias}, + + [string] + ${SecondaryEmail}, + + [object] + ${SecondaryOwnerAlias}, + + [object] + ${HostHeaderWebApplication}, + + [object] + ${ContentDatabase}, + + [object] + ${SiteSubscription}, + + [object] + ${AdministrationSiteType}, + + [int] + ${CompatibilityLevel}, + + [switch] + ${OverrideCompatibilityRestriction}, + + [switch] + ${CreateFromSiteMaster}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSiteMaster { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${Template}, + + [uint32] + ${Language}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSiteSubscription { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSiteSubscriptionFeaturePack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPStateServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPStateServiceApplicationProxy { + [CmdletBinding()] +param( + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ServiceApplication}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPStateServiceDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [ValidateRange(0, 10)] + [System.Nullable[int]] + ${Weight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSubscriptionSettingsServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ApplicationPool}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPSubscriptionSettingsServiceApplicationProxy { + [CmdletBinding(DefaultParameterSetName='Uri', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Uri', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Uri}, + + [Parameter(ParameterSetName='ServiceApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTranslationServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${PartitionMode}, + + [switch] + ${Default}, + + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTranslationServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [switch] + ${PartitionMode}, + + [Parameter(ParameterSetName='ConnectLocal', Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(ParameterSetName='ConnectRemote', Mandatory=$true)] + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportTrustCertificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ClaimsMappings}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SignInUrl}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${IdentifierClaim}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Realm}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [switch] + ${UseWReply}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet', Mandatory=$true)] + [switch] + ${UseDefaultConfiguration}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [ValidateSet('EMAIL','USER-PRINCIPAL-NAME','ACCOUNT-NAME')] + [string] + ${IdentifierClaimIs}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${SignOutUrl}, + + [Parameter(ParameterSetName='ActiveDirectoryBackedParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${RegisteredIssuerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ParameterSetName='ManualUpdateCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [ValidateNotNullOrEmpty()] + [string] + ${RegisteredIssuerName}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IsTrustBroker}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [string] + ${Name}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 135)] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 135)] + [string] + ${FailoverDatabaseServer}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='SQLAuthentication')] + [ValidateLength(1, 128)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='SQLAuthentication')] + [ValidateNotNull()] + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUsageLogFile { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${UserAlias}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [string] + ${Email}, + + [object] + ${Group}, + + [string[]] + ${PermissionLevel}, + + [string] + ${DisplayName}, + + [switch] + ${SiteCollectionAdmin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUserLicenseMapping { + [CmdletBinding(DefaultParameterSetName='WindowsAuth', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='WindowsAuth', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SecurityGroup}, + + [Parameter(ParameterSetName='FormsAuth', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Role}, + + [Parameter(ParameterSetName='FormsAuth', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${RoleProviderName}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${OriginalIssuer}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Value}, + + [Parameter(ParameterSetName='ClaimsValues', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ClaimType}, + + [Parameter(ParameterSetName='ClaimsValues')] + [ValidateNotNullOrEmpty()] + [string] + ${ValueType}, + + [Parameter(ParameterSetName='TrustIdentity', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Claim}, + + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${License}, + + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPUserSettingsProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [string] + ${DisplayName}, + + [Parameter(Mandatory=$true)] + [string] + ${AssemblyName}, + + [Parameter(Mandatory=$true)] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${DataProviderType}, + + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPVisioServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${AddToDefaultGroup}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPVisioServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [uint32] + ${Language}, + + [object] + ${Template}, + + [string] + ${Name}, + + [string] + ${Description}, + + [switch] + ${AddToQuickLaunch}, + + [switch] + ${UniquePermissions}, + + [switch] + ${AddToTopNav}, + + [switch] + ${UseParentTopNav}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWebApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [string] + ${ApplicationPool}, + + [object] + ${ApplicationPoolAccount}, + + [Alias('ProxyGroup')] + [object] + ${ServiceApplicationProxyGroup}, + + [switch] + ${SecureSocketsLayer}, + + [string] + ${HostHeader}, + + [uint32] + ${Port}, + + [switch] + ${AllowAnonymousAccess}, + + [string] + ${Path}, + + [string] + ${Url}, + + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [object] + ${AuthenticationProvider}, + + [object] + ${AdditionalClaimProvider}, + + [string] + ${SignInRedirectURL}, + + [object] + ${SignInRedirectProvider}, + + [object] + ${UserSettingsProvider}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWebApplicationAppDomain { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${AppDomain}, + + [object] + ${Zone}, + + [int] + ${Port}, + + [switch] + ${SecureSocketsLayer}, + + [Parameter(Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWebApplicationExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true)] + [object] + ${Zone}, + + [uint32] + ${Port}, + + [string] + ${HostHeader}, + + [string] + ${Path}, + + [string] + ${Url}, + + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [switch] + ${AllowAnonymousAccess}, + + [switch] + ${SecureSocketsLayer}, + + [object] + ${AuthenticationProvider}, + + [object] + ${AdditionalClaimProvider}, + + [string] + ${SignInRedirectURL}, + + [object] + ${SignInRedirectProvider}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [ValidateNotNullOrEmpty()] + [string] + ${FileName}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [switch] + ${AllowHTTP}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWOPISuppressionSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWordConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredential}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${PartitionMode}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWorkflowServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${PartitionMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWorkManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [switch] + ${Proxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function New-SPWorkManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true)] + [string] + ${Name}, + + [object] + ${ServiceApplication}, + + [string] + ${Uri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Pause-SPProjectWebInstance { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Publish-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [AllowEmptyString()] + [ValidateLength(0, 250)] + [string] + ${Description}, + + [ValidateNotNullOrEmpty()] + [uri] + ${InfoLink}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Receive-SPServiceApplicationConnectionInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${FarmUrl}, + + [ValidateNotNullOrEmpty()] + [string] + ${Filter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Register-SPAppPrincipal { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NameIdentifier}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DisplayName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Register-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [guid] + ${DatabaseId}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, Position=3)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [string] + ${DatabaseFailoverServer}, + + [switch] + ${IsSqlAzure}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseAccessCredentials}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [switch] + ${SkipWebApplicationUpdate}, + + [switch] + ${ForceDeleteLock}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Register-SPWorkflowService { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SPSite}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WorkflowHostUri}, + + [string] + ${ScopeName}, + + [switch] + ${PartitionMode}, + + [switch] + ${AllowOAuthHttp}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAccessServicesDatabaseServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServer}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPActivityFeedItems { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [bool] + ${AllItems}, + + [int] + ${ID}, + + [string] + ${SearchText}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAlternateURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAppDeniedEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Endpoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAppPrincipalPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${AppPrincipal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Scope}, + + [switch] + ${DisableAppOnlyPolicy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPAzureVideoServiceAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1)] + [object] + ${ServiceContext}, + + [Parameter(Position=2)] + [System.Net.ICredentials] + ${OAuth2BearerCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPBusinessDataCatalogModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPClaimTypeMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${TrustedIdentityTokenIssuer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPDeletedSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPDiagnosticsPerformanceCounter { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${WebFrontEnd}, + + [Parameter(ValueFromPipeline=$true)] + [switch] + ${DatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPDistributedCacheServiceInstance { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchTopology}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlCustomConnector { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlExtension { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [string] + ${UserNames}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchFileFormat { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchLanguageResourcePhrase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [object] + ${Type}, + + [string] + ${Language}, + + [string] + ${Mapping}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [guid] + ${SourceId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryDemoted { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('u')] + [uri] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Alias('n')] + [object] + ${Scope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchResultItemType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchServiceApplicationSiteSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${TenantId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchSiteHitRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchService}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchTenantConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Identity')] + [guid] + ${SiteSubscriptionId}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchTenantSchema { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPInfoPathUserAgent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPIPRangeAllowList { + [CmdletBinding(DefaultParameterSetName='CustomIPAllowList', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='CustomIPAllowList', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteName}, + + [Parameter(ParameterSetName='InternalIPAllowList', Mandatory=$true)] + [switch] + ${InternalIPAllowList}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IPV4}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IPV6}, + + [ValidateNotNullOrEmpty()] + [string] + ${IP}, + + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.List[string]] + ${IPList}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ChangePassword')] + [switch] + ${ChangePassword}, + + [Parameter(ParameterSetName='ChangePassword', Mandatory=$true)] + [securestring] + ${NewPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPManagedPath { + [CmdletBinding(DefaultParameterSetName='WebApplication', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='HostHeader', Mandatory=$true)] + [switch] + ${HostHeader}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPODataConnectionSetting { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPerformancePointServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPerformancePointServiceApplicationTrustedLocation { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPPluggableSecurityTrimmer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNull()] + [guid] + ${UserProfileApplicationProxyId}, + + [Parameter(Mandatory=$true)] + [int] + ${PlugInId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPProfileLeader { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPProfileSyncConnection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplication}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionForestName}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionDomain}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionUserName}, + + [Parameter(Mandatory=$true)] + [securestring] + ${ConnectionPassword}, + + [string] + ${ConnectionServerName}, + + [string] + ${ConnectionNamingContext}, + + [Parameter(Mandatory=$true)] + [string] + ${ConnectionSynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPProjectWebInstanceData { + [CmdletBinding(DefaultParameterSetName='web', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='web', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [switch] + ${DeleteData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSecureStoreApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSecureStoreSystemAccount { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [switch] + ${DeleteData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationProxyGroup { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPServiceApplicationProxyGroupMember { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [Alias('Proxy')] + [ValidateNotNull()] + [object] + ${Member}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPShellAdmin { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${UserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${database}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [switch] + ${DeleteADAccounts}, + + [switch] + ${GradualDelete}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteMaster { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ContentDatabase}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [guid] + ${SiteId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscription { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionBusinessDataCatalogConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionFeaturePack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionFeaturePackMember { + [CmdletBinding(DefaultParameterSetName='SingleFeatureDefinition', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SingleFeatureDefinition', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${FeatureDefinition}, + + [Parameter(ParameterSetName='AllFeatureDefinitions', Mandatory=$true)] + [switch] + ${AllFeatureDefinitions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionMetadataConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='ServiceContext', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteSubscriptionSettings { + [CmdletBinding(DefaultParameterSetName='SpecifySiteSubscriptions', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SpecifySiteSubscriptions', Mandatory=$true)] + [ValidateNotNull()] + [guid[]] + ${SiteSubscriptions}, + + [Parameter(ParameterSetName='FindAllOrphans', Mandatory=$true)] + [ValidateSet('True')] + [switch] + ${FindAllOrphans}, + + [Parameter(ParameterSetName='FindAllOrphans')] + [ValidateNotNull()] + [guid[]] + ${AlternativeSiteSubscriptions}, + + [Parameter(ParameterSetName='FindAllOrphans')] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteUpgradeSessionInfo { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSocialItemByDate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [bool] + ${RemoveTags}, + + [bool] + ${RemoveComments}, + + [bool] + ${RemoveRatings}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [datetime] + ${EndDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [uint32] + ${Language}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPSolutionDeploymentLock { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Position=0)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTranslationServiceJobHistory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeActiveJobs}, + + [System.Nullable[datetime]] + ${BeforeDate}, + + [System.Nullable[guid]] + ${JobId}, + + [System.Nullable[guid]] + ${PartitionId}, + + [switch] + ${AllPartitions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${UsageService}, + + [switch] + ${RemoveData}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [object] + ${Group}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUserLicenseMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNull()] + [System.Collections.Generic.List[guid]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUserSettingsProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${DataProviderType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Recycle}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWebApplication { + [CmdletBinding(DefaultParameterSetName='RemoveWebApp', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='RemoveZoneOfWebApp', Mandatory=$true)] + [object] + ${Zone}, + + [Parameter(ParameterSetName='RemoveWebApp')] + [switch] + ${RemoveContentDatabases}, + + [switch] + ${DeleteIISSite}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWebApplicationAppDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='Identity', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Application}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${Server}, + + [Parameter(ParameterSetName='Filter')] + [ValidateNotNullOrEmpty()] + [string] + ${WOPIZone}, + + [Parameter(ParameterSetName='RemoveAll')] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWOPISuppressionSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${Extension}, + + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${ProgId}, + + [Parameter(ParameterSetName='DocTypeAndAction')] + [ValidateNotNullOrEmpty()] + [string] + ${Action}, + + [Parameter(ParameterSetName='Identity', ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Remove-SPWordConversionServiceJobHistory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${IncludeActiveJobs}, + + [System.Nullable[datetime]] + ${BeforeDate}, + + [System.Nullable[guid]] + ${JobId}, + + [System.Nullable[guid]] + ${SubscriptionId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Rename-SPServer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Repair-SPManagedAccountDeployment { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Repair-SPProjectWebInstance { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='FindProjectSiteByWebInstance', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${RepairRule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Repair-SPSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [guid] + ${RuleId}, + + [switch] + ${RunAlways}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Request-SPUpgradeEvaluationSite { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${NoUpgrade}, + + [switch] + ${Email}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Reset-SPAccessServicesDatabasePassword { + [CmdletBinding(DefaultParameterSetName='ResetAllApps', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='ResetSingleApp', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(ParameterSetName='ResetSingleApp', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ResetAllApps', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Reset-SPProjectEventServiceSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Reset-SPProjectPCSSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Reset-SPProjectQueueSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Reset-SPSites { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restart-SPAppInstanceJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${AppInstance}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPDeletedSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [string] + ${Name}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='Config')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='Config')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='Config')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='Full', Mandatory=$true)] + [string] + ${TopologyFile}, + + [Parameter(Mandatory=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='Config', Mandatory=$true)] + [object] + ${AdminSearchServiceInstance}, + + [Parameter(ParameterSetName='Full')] + [switch] + ${KeepId}, + + [Parameter(ParameterSetName='Full')] + [switch] + ${DeferUpgradeActions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPEnterpriseSearchServiceApplicationIndex { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [object] + ${SearchApplication}, + + [Parameter(ParameterSetName='RestoreProgress', Mandatory=$true, Position=1)] + [string] + ${Handle}, + + [Parameter(ParameterSetName='Restore', Mandatory=$true, Position=1)] + [string] + ${BackupFolder}, + + [Parameter(ParameterSetName='Restore', Position=2)] + [switch] + ${AllReplicas}, + + [Parameter(ParameterSetName='Restore', Position=3)] + [switch] + ${AllowMove}, + + [Parameter(Position=4)] + [int] + ${Retries}, + + [Parameter(Position=5)] + [int] + ${RetryPauseSeconds}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPFarm { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Directory}, + + [Parameter(ParameterSetName='DefaultSet', Mandatory=$true)] + [ValidateSet('New','Overwrite')] + [string] + ${RestoreMethod}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${RestoreThreads}, + + [Parameter(ParameterSetName='DefaultSet')] + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [guid] + ${BackupId}, + + [Parameter(ParameterSetName='DefaultSet')] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='DefaultSet', ValueFromPipeline=$true)] + [pscredential] + ${FarmCredentials}, + + [string] + ${Item}, + + [Parameter(ParameterSetName='ShowTree', Mandatory=$true)] + [switch] + ${ShowTree}, + + [switch] + ${ConfigurationOnly}, + + [Parameter(ParameterSetName='DefaultSet')] + [int] + ${Percentage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Restore-SPSite { + [CmdletBinding(DefaultParameterSetName='DatabaseFromPipebind', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [string] + ${Path}, + + [string] + ${HostHeaderWebApplication}, + + [switch] + ${Force}, + + [switch] + ${GradualDelete}, + + [Parameter(ParameterSetName='DatabaseFromPipebind', ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='DatabaseParameter')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='DatabaseParameter')] + [string] + ${DatabaseServer}, + + [switch] + ${PreserveSiteID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Resume-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Resume-SPProjectWebInstance { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Resume-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Resume-SPVideoStreamingAccess { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Revoke-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Right}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Revoke-SPObjectSecurity { + [CmdletBinding(DefaultParameterSetName='RevokeOne')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='RevokeOne', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(ParameterSetName='RevokeOne', Position=2)] + [ValidateNotNull()] + [string[]] + ${Rights}, + + [Parameter(ParameterSetName='RevokeAll', Mandatory=$true)] + [switch] + ${All}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(1, 255)] + [int] + ${ColumnsMax}, + + [ValidateRange(1, 200000)] + [int] + ${RowsMax}, + + [ValidateRange(1, 20)] + [int] + ${SourcesMax}, + + [ValidateRange(0, 32)] + [int] + ${OutputCalculatedColumnsMax}, + + [ValidateRange(0, 8)] + [int] + ${OrderByMax}, + + [switch] + ${OuterJoinsAllowed}, + + [switch] + ${NonRemotableQueriesAllowed}, + + [ValidateRange(-1, 2147483647)] + [int] + ${RecordsInTableMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${ApplicationLogSizeMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(0, 4096)] + [int] + ${SessionMemoryMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${TemplateSizeMax}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServicesApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(-1, 2073600)] + [int] + ${RequestDurationMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerUserMax}, + + [ValidateRange(-1, 2147483647)] + [int] + ${SessionsPerAnonymousUserMax}, + + [ValidateRange(-1, 2073600)] + [int] + ${CacheTimeout}, + + [ValidateRange(-1, 2147483647)] + [int] + ${PrivateBytesMax}, + + [ValidateRange(-1, 1440)] + [int] + ${RecoveryPointObjective}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServicesDatabaseServer { + [CmdletBinding(DefaultParameterSetName='SetCredentialsParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [Parameter(Mandatory=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [Parameter(Mandatory=$true)] + [Parameter(ParameterSetName='SetCredentialsParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServer}, + + [Parameter(ParameterSetName='SetCredentialsParameterSet')] + [string] + ${DatabaseServerName}, + + [Parameter(ParameterSetName='SetCredentialsParameterSet')] + [pscredential] + ${DatabaseServerCredentials}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [bool] + ${AvailableForCreate}, + + [Parameter(ParameterSetName='SetAvailableForCreateParameterSet')] + [ValidateNotNullOrEmpty()] + [bool] + ${Exclusive}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [bool] + ${Encrypt}, + + [Parameter(ParameterSetName='SetEncryptParameterSet', Mandatory=$true)] + [bool] + ${TrustServerCertificate}, + + [Parameter(ParameterSetName='SetSecondaryDatabaseServerNameParameterSet')] + [string] + ${SecondaryDatabaseServerName}, + + [Parameter(ParameterSetName='SetFailoverParameterSet', Mandatory=$true)] + [bool] + ${Failover}, + + [Parameter(ParameterSetName='SetUserDomainParameterSet', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UserDomain}, + + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [object] + ${State}, + + [Parameter(ParameterSetName='SetServerStateParameterSet', Mandatory=$true)] + [object] + ${StateOwner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAccessServicesDatabaseServerGroupMapping { + [CmdletBinding(DefaultParameterSetName='SetDatabaseServerGroupMappingParameter', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${DatabaseServerGroup}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${CorporateCatalog}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${ObjectModel}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${RemoteObjectModel}, + + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [switch] + ${DeveloperSite}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName')] + [Parameter(ParameterSetName='SetDatabaseServerGroupMappingParameter')] + [switch] + ${StoreFront}, + + [Parameter(ParameterSetName='ClearDatabaseServerGroupMappingParameterSetName', Mandatory=$true)] + [switch] + ${ClearMapping}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAlternateURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Url}, + + [object] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppAcquisitionConfiguration { + [CmdletBinding(DefaultParameterSetName='MarketplaceSettingsInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ParameterSetName='MarketplaceSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='MarketplaceSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppAutoProvisionConnection { + [CmdletBinding()] +param( + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostEndPoint', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [object] + ${ConnectionType}, + + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${Username}, + + [Parameter(ParameterSetName='WebHostCredential', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${Password}, + + [Parameter(ParameterSetName='WebHostEndPoint', Mandatory=$true)] + [Parameter(ParameterSetName='WebHostSetup', Mandatory=$true)] + [string] + ${EndPoint}, + + [Parameter(ParameterSetName='Remove', Mandatory=$true)] + [switch] + ${Remove}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppDisablingConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0)] + [AllowEmptyString()] + [AllowNull()] + [string] + ${AppDomain}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppHostingQuotaConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [double] + ${AppHostingLicenseQuota}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [double] + ${AppInstanceCountQuota}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppManagementDeploymentId { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${DeploymentId}, + + [Parameter(ValueFromPipeline=$true)] + [Alias('Subscription')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${AppManagementServiceApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppPrincipalPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${AppPrincipal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Scope}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Right}, + + [switch] + ${EnableAppOnlyPolicy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppScaleProfile { + [CmdletBinding()] +param( + [ValidateNotNullOrEmpty()] + [string] + ${MaxDatabaseSize}, + + [ValidateRange(1, 255)] + [int] + ${RemoteWebSiteInstanceCount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppSiteDomain { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppSiteSubscriptionName { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [object] + ${SiteSubscription}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppStateUpdateInterval { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${AppStateSyncHours}, + + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${FastAppRevocationHours}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppStoreConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [string] + ${Url}, + + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAppStoreWebServiceConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${Client}, + + [version] + ${ProxyVersion}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPAuthenticationRealm { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [string] + ${Realm}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBingMapsBlock { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, HelpMessage='Block Bing Maps in all locales.')] + [switch] + ${BlockBingMapsInAllLocales}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBingMapsKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, HelpMessage='Enter the Bing Maps API key.')] + [string] + ${BingKey}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBrowserCustomerExperienceImprovementProgram { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(ParameterSetName='Farm', Mandatory=$true)] + [switch] + ${Farm}, + + [Parameter(ParameterSetName='WebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteSubscription', Mandatory=$true)] + [object] + ${SiteSubscription}, + + [switch] + ${Enable}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogEntityNotificationWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Web}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogMetadataObject { + [CmdletBinding(DefaultParameterSetName='NameValue', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Display')] + [string] + ${DisplayName}, + + [Parameter(ParameterSetName='NameRemove')] + [Parameter(ParameterSetName='NameValue')] + [ValidateNotNull()] + [string] + ${PropertyName}, + + [Parameter(ParameterSetName='NameValue')] + [psobject] + ${PropertyValue}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='NameRemove')] + [switch] + ${Remove}, + + [string] + ${SettingId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${Sharing}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseName}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${DatabaseUsername}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPBusinessDataCatalogThrottleConfig { + [CmdletBinding(DefaultParameterSetName='MaxDefault', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='MaxDefault', Mandatory=$true)] + [int] + ${Maximum}, + + [Parameter(ParameterSetName='MaxDefault', Mandatory=$true)] + [int] + ${Default}, + + [Parameter(ParameterSetName='Enforcement', Mandatory=$true)] + [switch] + ${Enforced}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPCentralAdministration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [int] + ${Port}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPClaimProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [switch] + ${Enabled}, + + [switch] + ${Default}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPContentDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateRange(1, 2147483647)] + [int] + ${MaxSiteCount}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${WarningSiteCount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Status}, + + [Parameter(ValueFromPipeline=$true)] + [string] + ${DatabaseFailoverServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Description}, + + [object] + ${Scope}, + + [string] + ${Schedule}, + + [switch] + ${ScheduleEnabled}, + + [switch] + ${IncrementalEnabled}, + + [object] + ${SqlSnapshotSetting}, + + [switch] + ${HostingSupportEnabled}, + + [object] + ${EmailNotifications}, + + [string[]] + ${EmailAddresses}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPContentDeploymentPath { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Name}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Description}, + + [uri] + ${DestinationCentralAdministrationURL}, + + [object] + ${Authentication}, + + [pscredential] + ${PathAccount}, + + [switch] + ${DeployUserNamesEnabled}, + + [object] + ${DeploySecurityInformation}, + + [switch] + ${EventReceiversEnabled}, + + [switch] + ${CompressionEnabled}, + + [switch] + ${PathEnabled}, + + [object] + ${KeepTemporaryFilesOptions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPCustomLayoutsPage { + [CmdletBinding(DefaultParameterSetName='CustomPage', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='CustomPage', Mandatory=$true)] + [string] + ${RelativePath}, + + [Parameter(ParameterSetName='CustomPage')] + [Parameter(ParameterSetName='ResetCustomPage')] + [ValidateRange(14, 15)] + [int] + ${CompatibilityLevel}, + + [Parameter(ParameterSetName='ResetCustomPage', Mandatory=$true)] + [switch] + ${Reset}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateLength(0, 255)] + [string] + ${DisplayName}, + + [ValidateLength(0, 255)] + [string] + ${Description}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [ValidateSet('true','false')] + [string] + ${WebAccessible}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDefaultProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(Mandatory=$true)] + [bool] + ${MySitesPublicEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDesignerSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [bool] + ${AllowDesigner}, + + [bool] + ${AllowRevertFromTemplate}, + + [bool] + ${AllowMasterPageEditing}, + + [bool] + ${ShowURLStructure}, + + [string] + ${RequiredDesignerVersion}, + + [string] + ${DesignerDownloadUrl}, + + [bool] + ${AllowCreateDeclarativeWorkflow}, + + [bool] + ${AllowSavePublishDeclarativeWorkflow}, + + [bool] + ${AllowSaveDeclarativeWorkflowAsTemplate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDiagnosticConfig { + [CmdletBinding()] +param( + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${AllowLegacyTraceProviders}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${AppAnalyticsAutomaticUploadEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${CustomerExperienceImprovementProgramEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ErrorReportingEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ErrorReportingAutomaticUploadEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${DownloadErrorReportingUpdatesEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 366)] + [int] + ${DaysToKeepLogs}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${LogMaxDiskSpaceUsageEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1000)] + [int] + ${LogDiskSpaceUsageGB}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${LogLocation}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${LogCutInterval}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${EventLogFloodProtectionEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 100)] + [int] + ${EventLogFloodProtectionThreshold}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionTriggerPeriod}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionQuietPeriod}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${EventLogFloodProtectionNotifyInterval}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ScriptErrorReportingEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${ScriptErrorReportingRequireAuth}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [ValidateRange(1, 1440)] + [int] + ${ScriptErrorReportingDelay}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDiagnosticsProvider { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Enable}, + + [ValidateRange(1, 31)] + [int] + ${DaysRetained}, + + [ValidateRange(1, 9223372036854775807)] + [long] + ${MaxTotalSizeInBytes}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPDistributedCacheClientSetting { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ContainerType}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${DistributedCacheClientSettings}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchAdministrationComponent { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${StoragePath}, + + [object] + ${SearchServiceInstance}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchContentEnrichmentConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${ContentEnrichmentConfiguration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlContentSource { + [CmdletBinding(DefaultParameterSetName='NoSchedule', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('t')] + [string] + ${Tag}, + + [Alias('s')] + [string] + ${StartAddresses}, + + [Alias('p')] + [object] + ${CrawlPriority}, + + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='RemoveSchedule')] + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Daily', Mandatory=$true)] + [System.Nullable`1[[object]]] + ${ScheduleType}, + + [Parameter(ParameterSetName='Daily')] + [Alias('daily')] + [switch] + ${DailyCrawlSchedule}, + + [Parameter(ParameterSetName='Weekly')] + [Alias('weekly')] + [switch] + ${WeeklyCrawlSchedule}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('monthly')] + [switch] + ${MonthlyCrawlSchedule}, + + [Parameter(ParameterSetName='RemoveSchedule')] + [switch] + ${RemoveCrawlSchedule}, + + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('start')] + [System.Nullable[datetime]] + ${CrawlScheduleStartDateTime}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Weekly')] + [Parameter(ParameterSetName='Daily')] + [Alias('duration')] + [System.Nullable[int]] + ${CrawlScheduleRepeatDuration}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('interval')] + [System.Nullable[int]] + ${CrawlScheduleRepeatInterval}, + + [Parameter(ParameterSetName='Daily')] + [Parameter(ParameterSetName='Weekly')] + [Alias('every')] + [System.Nullable[int]] + ${CrawlScheduleRunEveryInterval}, + + [Parameter(ParameterSetName='Weekly')] + [object] + ${CrawlScheduleDaysOfWeek}, + + [Parameter(ParameterSetName='MonthlyDate')] + [System.Nullable[int]] + ${CrawlScheduleDaysOfMonth}, + + [Parameter(ParameterSetName='MonthlyDate')] + [Alias('month')] + [object] + ${CrawlScheduleMonthsOfYear}, + + [System.Nullable[int]] + ${MaxPageEnumerationDepth}, + + [System.Nullable[int]] + ${MaxSiteEnumerationDepth}, + + [object] + ${BDCApplicationProxyGroup}, + + [string[]] + ${LOBSystemSet}, + + [string] + ${CustomProtocol}, + + [System.Nullable[bool]] + ${EnableContinuousCrawls}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlLogReadPermission { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [guid] + ${Tenant}, + + [string] + ${UserNames}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchCrawlRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('t')] + [object] + ${Type}, + + [System.Nullable[bool]] + ${IsAdvancedRegularExpression}, + + [System.Nullable[bool]] + ${CrawlAsHttp}, + + [System.Nullable[bool]] + ${FollowComplexUrls}, + + [System.Nullable[int]] + ${PluggableSecurityTimmerId}, + + [System.Nullable[bool]] + ${SuppressIndexing}, + + [System.Nullable[int]] + ${Priority}, + + [string] + ${ContentClass}, + + [object] + ${AuthenticationType}, + + [string] + ${AccountName}, + + [securestring] + ${AccountPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchFileFormatState { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [bool] + ${Enable}, + + [Parameter(Position=2)] + [System.Nullable[bool]] + ${UseIFilter}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchLinguisticComponentsStatus { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [System.Nullable[bool]] + ${ThesaurusEnabled}, + + [System.Nullable[bool]] + ${StemmingEnabled}, + + [System.Nullable[bool]] + ${QuerySpellingEnabled}, + + [System.Nullable[bool]] + ${EntityExtractionEnabled}, + + [System.Nullable[bool]] + ${AllEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchLinksDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataCategory { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [System.Nullable[bool]] + ${DiscoverNewProperties}, + + [Alias('m')] + [System.Nullable[bool]] + ${MapToContents}, + + [Alias('auto')] + [System.Nullable[bool]] + ${AutoCreateNewManagedProperties}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataCrawledProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [Alias('im')] + [System.Nullable[bool]] + ${IsMappedToContents}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataManagedProperty { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('f')] + [System.Nullable[bool]] + ${FullTextQueriable}, + + [Alias('r')] + [System.Nullable[bool]] + ${Retrievable}, + + [Alias('e')] + [System.Nullable[bool]] + ${EnabledForScoping}, + + [Alias('nn')] + [System.Nullable[bool]] + ${NameNormalized}, + + [Alias('rp')] + [System.Nullable[bool]] + ${RespectPriority}, + + [Alias('rd')] + [System.Nullable[bool]] + ${RemoveDuplicates}, + + [Alias('im5')] + [Obsolete('This property is replaced by IncludeInAlertSignature.')] + [System.Nullable[bool]] + ${IncludeInMd5}, + + [Alias('ia')] + [System.Nullable[bool]] + ${IncludeInAlertSignature}, + + [Alias('sfa')] + [System.Nullable[bool]] + ${SafeForAnonymous}, + + [Alias('nw')] + [System.Nullable[bool]] + ${NoWordBreaker}, + + [Alias('u')] + [System.Nullable[int16]] + ${UserFlags}, + + [Alias('qir')] + [System.Nullable[bool]] + ${EnabledForQueryIndependentRank}, + + [Alias('def')] + [System.Nullable[uint32]] + ${DefaultForQueryIndependentRank}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchMetadataMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [object] + ${ManagedProperty}, + + [object] + ${CrawledProperty}, + + [guid] + ${Tenant}, + + [guid] + ${SiteCollection}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchPrimaryHostController { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SearchServiceInstance}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Alias('l')] + [System.Nullable[float]] + ${Level}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryKeyword { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Alias('t')] + [string] + ${Term}, + + [Alias('d')] + [string] + ${Definition}, + + [Alias('c')] + [string] + ${Contact}, + + [Alias('s')] + [System.Nullable[datetime]] + ${StartDate}, + + [Alias('e')] + [System.Nullable[datetime]] + ${EndDate}, + + [Alias('r')] + [System.Nullable[datetime]] + ${ReviewDate}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryScope { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [uri] + ${Url}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [string] + ${AlternateResultsPage}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('d')] + [string] + ${Description}, + + [Alias('disp')] + [System.Nullable[bool]] + ${DisplayInAdminUI}, + + [Alias('type')] + [System.Nullable[int]] + ${CompilationType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQueryScopeRule { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('u')] + [uri] + ${Url}, + + [Alias('n')] + [object] + ${Scope}, + + [Alias('f')] + [string] + ${FilterBehavior}, + + [Alias('ut')] + [string] + ${UrlScopeRuleType}, + + [Alias('text')] + [string] + ${MatchingString}, + + [Alias('value')] + [string] + ${PropertyValue}, + + [Alias('mname')] + [string] + ${ManagedPropertyName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchQuerySpellingCorrection { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [object] + ${SearchApplication}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [System.Nullable[bool]] + ${ContentAlignmentEnabled}, + + [System.Nullable[int]] + ${MaxDictionarySize}, + + [System.Nullable[bool]] + ${DiacriticsInSuggestionsEnabled}, + + [System.Nullable[int]] + ${TermFrequencyThreshold}, + + [System.Nullable[bool]] + ${SecurityTrimmingEnabled}, + + [object] + ${SpellingDictionary}, + + [System.Nullable[timespan]] + ${MaxProcessingTime}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchRankingModel { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Parameter(Mandatory=$true)] + [string] + ${RankingModelXML}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchResultItemType { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplicationProxy}, + + [Alias('n')] + [string] + ${Name}, + + [Alias('rule')] + [object] + ${Rules}, + + [Alias('priority')] + [System.Nullable[int]] + ${RulePriority}, + + [Alias('dp')] + [string] + ${DisplayProperties}, + + [Alias('sid')] + [System.Nullable[guid]] + ${SourceID}, + + [Alias('url')] + [string] + ${DisplayTemplateUrl}, + + [Parameter(Mandatory=$true)] + [Alias('o')] + [object] + ${Owner}, + + [Alias('opt')] + [System.Nullable[bool]] + ${OptimizeForFrequentUse}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchResultSource { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SearchApplication}, + + [Alias('o')] + [object] + ${Owner}, + + [string] + ${Name}, + + [string] + ${Description}, + + [string] + ${QueryTemplate}, + + [guid] + ${ProviderId}, + + [string] + ${RemoteUrl}, + + [System.Nullable[bool]] + ${AutoDiscover}, + + [object] + ${AuthenticationType}, + + [string] + ${UserName}, + + [string] + ${Password}, + + [string] + ${SsoId}, + + [System.Nullable[bool]] + ${MakeDefault}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${ServiceAccount}, + + [securestring] + ${ServicePassword}, + + [string] + ${ContactEmail}, + + [string] + ${ConnectionTimeout}, + + [string] + ${AcknowledgementTimeout}, + + [string] + ${ProxyType}, + + [string] + ${IgnoreSSLWarnings}, + + [string] + ${InternetIdentity}, + + [string] + ${PerformanceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${DiacriticSensitive}, + + [object] + ${DefaultSearchProvider}, + + [string] + ${VerboseQueryMonitoring}, + + [object] + ${ApplicationPool}, + + [object] + ${AdminApplicationPool}, + + [string] + ${DefaultContentAccessAccountName}, + + [securestring] + ${DefaultContentAccessAccountPassword}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseUsername}, + + [securestring] + ${DatabasePassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${DefaultIndexLocation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPEnterpriseSearchTopology { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${SearchApplication}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPFarmConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowBatchSize}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowPostponeThreshold}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [int] + ${WorkflowEventDeliveryTimeout}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${InstalledProductsRefresh}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${DataFormWebPartAutoRefreshEnabled}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${ASPScriptOptimizationEnabled}, + + [switch] + ${ServiceConnectionPointDelete}, + + [string] + ${ServiceConnectionPointBindingInformation}, + + [object] + ${SiteMasterMode}, + + [System.Nullable[uint32]] + ${SiteMasterValidationIntervalInHours}, + + [System.Nullable[bool]] + ${DefaultActivateOnSiteMasterValue}, + + [switch] + ${Force}, + + [System.Nullable[switch]] + ${UserAccountDirectoryPathIsImmutable}, + + [System.Nullable[uint32]] + ${MaxTenantStoreValueLength}, + + [System.Nullable[uint32]] + ${MaxSiteSubscriptionSettingsValueLength}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInfoPathFormsService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Identity}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormBrowserEnabling}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormBrowserRendering}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${DefaultDataConnectionTimeout}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MemoryCacheSize}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MaxDataConnectionTimeout}, + + [ValidateRange(0, 2147483647)] + [System.Nullable[int]] + ${MaxDataConnectionResponseSize}, + + [ValidateSet('true','false')] + [string] + ${RequireSslForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowEmbeddedSqlForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowUdcAuthenticationForDataConnections}, + + [ValidateSet('true','false')] + [string] + ${AllowUserFormCrossDomainDataConnections}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${MaxPostbacksPerSession}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${MaxUserActionsPerPostback}, + + [ValidateRange(0, 999999)] + [System.Nullable[int]] + ${ActiveSessionTimeout}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxSizeOfUserFormState}, + + [ValidateSet('true','false')] + [string] + ${AllowViewState}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${ViewStateThreshold}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxFormLoadTime}, + + [ValidateRange(0, 99999999)] + [System.Nullable[int]] + ${MaxDataConnectionRoundTrip}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateLength(0, 255)] + [string] + ${Category}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInfoPathWebServiceProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateSet('true','false')] + [string] + ${AllowWebServiceProxy}, + + [ValidateSet('true','false')] + [string] + ${AllowForUserForms}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInsightsAuthSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [string] + ${LogFEEndpoint}, + + [Parameter(Mandatory=$true)] + [string] + ${Tenant}, + + [Parameter(Mandatory=$true)] + [string] + ${LogClientAppId}, + + [Parameter(Mandatory=$true)] + [string] + ${LogClientCertificateSubject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPInternalAppStateUpdateInterval { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [ValidateRange(0, 32768)] + [int] + ${AppStateSyncHours}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPIPAccessControlOperationMode { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${OperationMode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPIPAccessControlSubscriptionId { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscriptionId}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [switch] + ${Enabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPIPRangeAllowList { + [CmdletBinding(DefaultParameterSetName='CustomIPAllowList', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='CustomIPAllowList', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteName}, + + [Parameter(ParameterSetName='InternalIPAllowList', Mandatory=$true)] + [switch] + ${InternalIPAllowList}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IPV4}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IPV6}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [System.Collections.Generic.List[string]] + ${IPList}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPIPRangeAllowListSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteName}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${IPAddressAllowanceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPIRMSettings { + [CmdletBinding(DefaultParameterSetName='UseServiceDiscovery', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [switch] + ${IrmEnabled}, + + [switch] + ${SubscriptionScopeSettingsEnabled}, + + [Parameter(ParameterSetName='UseServiceDiscovery')] + [switch] + ${UseActiveDirectoryDiscovery}, + + [Parameter(ParameterSetName='UseSpecifiedCertificateUrl', Mandatory=$true)] + [uri] + ${CertificateServerUrl}, + + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ServiceAuthenticationCertificate}, + + [ValidateNotNull()] + [securestring] + ${CertificatePassword}, + + [switch] + ${UseOauth}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPLogLevel { + [CmdletBinding()] +param( + [string] + ${TraceSeverity}, + + [string] + ${EventSeverity}, + + [string[]] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [psobject] + ${InputObject}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPManagedAccount { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Schedule}, + + [int] + ${PreExpireDays}, + + [int] + ${EmailNotification}, + + [Parameter(ParameterSetName='AutoGeneratePassword')] + [switch] + ${AutoGeneratePassword}, + + [Parameter(ParameterSetName='NewPasswordAsParameter', Mandatory=$true)] + [securestring] + ${Password}, + + [Parameter(ParameterSetName='NewPassword')] + [switch] + ${SetNewPassword}, + + [Parameter(ParameterSetName='NewPassword', Mandatory=$true)] + [securestring] + ${NewPassword}, + + [Parameter(ParameterSetName='NewPassword', Mandatory=$true)] + [securestring] + ${ConfirmPassword}, + + [Parameter(ParameterSetName='ExistingPassword')] + [switch] + ${UseExistingPassword}, + + [Parameter(ParameterSetName='ExistingPassword', Mandatory=$true)] + [securestring] + ${ExistingPassword}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMetadataServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [string] + ${AdministratorAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string] + ${DatabaseName}, + + [string] + ${DatabaseServer}, + + [pscredential] + ${DatabaseCredentials}, + + [string] + ${FailoverDatabaseServer}, + + [string] + ${FullAccessAccount}, + + [string] + ${HubUri}, + + [int] + ${CacheTimeCheckInterval}, + + [int] + ${MaxChannelCache}, + + [switch] + ${DoNotUnpublishAllPackages}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Quota', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Default', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [string] + ${ReadAccessAccount}, + + [string] + ${RestrictedAccount}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [Parameter(ParameterSetName='NoQuota', Mandatory=$true)] + [switch] + ${DisablePartitionQuota}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${GroupsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermSetsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${TermsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${LabelsPerPartition}, + + [Parameter(ParameterSetName='Quota', Mandatory=$true)] + [ValidateRange(0, 2147483647)] + [int] + ${PropertiesPerPartition}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMetadataServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [switch] + ${ContentTypeSyndicationEnabled}, + + [switch] + ${ContentTypePushdownEnabled}, + + [switch] + ${DefaultKeywordTaxonomy}, + + [switch] + ${DefaultProxyGroup}, + + [switch] + ${DefaultSiteCollectionTaxonomy}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMicrofeedOptions { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [ValidateNotNull()] + [int] + ${MaxPostLength}, + + [ValidateNotNull()] + [int] + ${MaxMentions}, + + [ValidateNotNull()] + [int] + ${MaxTags}, + + [ValidateNotNull()] + [System.Nullable[bool]] + ${AsyncRefs}, + + [ValidateNotNull()] + [int] + ${MaxCacheMs}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPMobileMessagingAccount { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [Alias('ServiceType','AccountType')] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [string] + ${ServiceName}, + + [string] + ${ServiceUrl}, + + [string] + ${UserId}, + + [string] + ${Password}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPO365LinkSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [AllowEmptyString()] + [string] + ${MySiteHostUrl}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string[]] + ${Audiences}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [bool] + ${RedirectSites}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPODataConnectionSetting { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 246)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${ServiceAddressURL}, + + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateNotNull()] + [ValidateLength(0, 1024)] + [string] + ${SecureStoreTargetApplicationId}, + + [string] + ${ExtensionProvider}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPODataConnectionSettingMetadata { + [CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceContext}, + + [Parameter(ParameterSetName='Name', Mandatory=$true)] + [ValidateNotNull()] + [ValidateLength(0, 255)] + [string] + ${Name}, + + [ValidateNotNull()] + [uri] + ${ServiceAddressMetadataURL}, + + [ValidateNotNull()] + [object] + ${AuthenticationMode}, + + [ValidateLength(0, 1024)] + [ValidateNotNull()] + [string] + ${SecureStoreTargetApplicationId}, + + [Parameter(ParameterSetName='Identity', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPOfficeStoreAppsDefaultActivation { + [CmdletBinding(DefaultParameterSetName='AppsForOfficeSettingsInWebApplication', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [bool] + ${Enable}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInWebApplication', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='AppsForOfficeSettingsInSiteSubscription', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPassPhrase { + [CmdletBinding(DefaultParameterSetName='AcrossFarm', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [securestring] + ${PassPhrase}, + + [Parameter(ParameterSetName='AcrossFarm', Mandatory=$true)] + [securestring] + ${ConfirmPassPhrase}, + + [Parameter(ParameterSetName='LocalOnly')] + [switch] + ${LocalServerOnly}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPerformancePointSecureDataValues { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ServiceApplication}, + + [Parameter(Mandatory=$true)] + [pscredential] + ${DataSourceUnattendedServiceAccount}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPerformancePointServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${ApplicationPool}, + + [bool] + ${CommentsDisabled}, + + [int] + ${CommentsScorecardMax}, + + [int] + ${IndicatorImageCacheSeconds}, + + [int] + ${DataSourceQueryTimeoutSeconds}, + + [int] + ${FilterRememberUserSelectionsDays}, + + [int] + ${FilterTreeMembersMax}, + + [int] + ${FilterSearchResultsMax}, + + [int] + ${ShowDetailsInitialRows}, + + [bool] + ${ShowDetailsMaxRowsDisabled}, + + [int] + ${ShowDetailsMaxRows}, + + [bool] + ${MSMQEnabled}, + + [string] + ${MSMQName}, + + [int] + ${SessionHistoryHours}, + + [bool] + ${AnalyticQueryLoggingEnabled}, + + [bool] + ${TrustedDataSourceLocationsRestricted}, + + [bool] + ${TrustedContentLocationsRestricted}, + + [int] + ${SelectMeasureMaximum}, + + [int] + ${DecompositionTreeMaximum}, + + [bool] + ${ApplicationProxyCacheEnabled}, + + [bool] + ${ApplicationCacheEnabled}, + + [int] + ${ApplicationCacheMinimumHitCount}, + + [int] + ${AnalyticResultCacheMinimumHitCount}, + + [int] + ${ElementCacheSeconds}, + + [int] + ${AnalyticQueryCellMax}, + + [string] + ${SettingsDatabase}, + + [string] + ${DatabaseServer}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseSQLAuthenticationCredential}, + + [string] + ${DatabaseFailoverServer}, + + [bool] + ${DatabaseUseWindowsAuthentication}, + + [string] + ${DataSourceUnattendedServiceAccountTargetApplication}, + + [bool] + ${UseEffectiveUserName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPPowerPointConversionServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [uint32] + ${CacheExpirationPeriodInSeconds}, + + [uint32] + ${WorkerProcessCount}, + + [uint32] + ${WorkerKeepAliveTimeoutInSeconds}, + + [uint32] + ${WorkerTimeoutInSeconds}, + + [uint32] + ${MaximumConversionsPerWorker}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [string] + ${Name}, + + [object] + ${ApplicationPool}, + + [pscredential] + ${ProfileDBCredentials}, + + [string] + ${ProfileDBFailoverServer}, + + [pscredential] + ${SocialDBCredentials}, + + [string] + ${SocialDBFailoverServer}, + + [pscredential] + ${ProfileSyncDBCredentials}, + + [string] + ${ProfileSyncDBFailoverServer}, + + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [bool] + ${PurgeNonImportedObjects}, + + [bool] + ${UseOnlyPreferredDomainControllers}, + + [bool] + ${GetNonImportedObjects}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProfileServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [string] + ${Name}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProfileServiceApplicationSecurity { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [ValidateSet('UserACL','MySiteReaderACL')] + [string] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectDatabaseQuota { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ParameterSetName='settings', Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${Settings}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [switch] + ${Enabled}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [ValidateRange(0, 1024000)] + [int] + ${ReadOnlyLimit}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [ValidateRange(0, 100)] + [int] + ${ReadOnlyWarningThreshold}, + + [Parameter(ParameterSetName='options', Mandatory=$true)] + [ValidateRange(0, 1024000)] + [int] + ${MaxDbSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectEventServiceSettings { + [CmdletBinding()] +param( + [System.Nullable[int]] + ${NetTcpPort}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectOdataConfiguration { + [CmdletBinding()] +param( + [bool] + ${UseVerboseErrors}, + + [ValidateRange(1, 2147483647)] + [int] + ${MaxResultsPerCollection}, + + [bool] + ${AcceptCountRequests}, + + [bool] + ${AcceptProjectionRequests}, + + [ValidateRange(1, 2147483647)] + [int] + ${DefaultMaxPageSize}, + + [switch] + ${ClearEntityPageSizeOverrides}, + + [string] + ${EntitySetName}, + + [ValidateRange(1, 2147483647)] + [int] + ${PageSizeOverride}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectPCSSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [System.Nullable[int]] + ${MaximumIdleWorkersCount}, + + [System.Nullable[int]] + ${MaximumWorkersCount}, + + [System.Nullable[int]] + ${EditingSessionTimeout}, + + [System.Nullable[int]] + ${MaximumSessionsPerUser}, + + [System.Nullable[int]] + ${CachePersistence}, + + [System.Nullable[int]] + ${MinimumMemoryRequired}, + + [System.Nullable[int]] + ${RequestTimeLimits}, + + [System.Nullable[int]] + ${MaximumProjectSize}, + + [System.Nullable[int]] + ${NetTcpPort}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectPermissionMode { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateSet('SharePoint','ProjectServer')] + [ValidateNotNullOrEmpty()] + [object] + ${Mode}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectQueueSettings { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [Alias('sa')] + [object] + ${ServiceApplication}, + + [System.Nullable[int]] + ${MaxDegreeOfConcurrency}, + + [System.Nullable[int]] + ${MsgRetryInterval}, + + [System.Nullable[int]] + ${MsgRetryLimit}, + + [System.Nullable[int]] + ${SqlRetryInterval}, + + [System.Nullable[int]] + ${SqlRetryLimit}, + + [System.Nullable[int]] + ${SqlCommandTimeout}, + + [System.Nullable[int]] + ${CleanupSuccessAgeLimit}, + + [System.Nullable[int]] + ${CleanupNonSuccessAgeLimit}, + + [System.Nullable[int]] + ${PeriodicTasksInterval}, + + [System.Nullable[int]] + ${QueueTimeout}, + + [System.Nullable[int]] + ${MaxConnections}, + + [System.Nullable[int]] + ${NetTcpPort}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [object] + ${ApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectUserSync { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [object] + ${Value}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectUserSyncDisabledSyncThreshold { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [int] + ${Threshold}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectUserSyncFullSyncThreshold { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [int] + ${Threshold}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPProjectUserSyncOffPeakSyncThreshold { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(Mandatory=$true, Position=2)] + [ValidateNotNullOrEmpty()] + [int] + ${Threshold}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRequestManagementSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [System.Nullable[switch]] + ${RoutingEnabled}, + + [ValidateNotNull()] + [System.Nullable[switch]] + ${ThrottlingEnabled}, + + [ValidateNotNull()] + [object] + ${RoutingScheme}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRoutingMachineInfo { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Availability}, + + [ValidateNotNull()] + [object] + ${OutgoingScheme}, + + [ValidateRange(1, 65535)] + [ValidateNotNull()] + [System.Nullable[int]] + ${OutgoingPort}, + + [ValidateNotNull()] + [switch] + ${ClearOutgoingPort}, + + [ValidateNotNull()] + [System.Nullable[double]] + ${StaticWeight}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRoutingMachinePool { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${MachineTargets}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRoutingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [object] + ${MachinePool}, + + [ValidateNotNull()] + [System.Nullable[int]] + ${ExecutionGroup}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPRuntimeTelemetry { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [int] + ${Interval}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPScaleOutDatabaseDataRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [object] + ${Range}, + + [byte[]] + ${NewRangePoint}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPScaleOutDatabaseDataSubRange { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [byte[]] + ${SubRangePoint}, + + [Parameter(Mandatory=$true)] + [object] + ${SubRangeMode}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [switch] + ${IgnoreSubRangePointOnBoundary}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecureStoreApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [object] + ${Administrator}, + + [object] + ${CredentialsOwnerGroup}, + + [object] + ${Fields}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [object] + ${TargetApplication}, + + [object] + ${TicketRedeemer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecureStoreDefaultProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [type] + ${Type}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecureStoreServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='MinDBSet')] + [Parameter(ParameterSetName='NoMinDBSet')] + [object] + ${ApplicationPool}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [Parameter(ParameterSetName='MinDBSet')] + [switch] + ${AuditingEnabled}, + + [Parameter(ParameterSetName='MinDBSet')] + [Parameter(ParameterSetName='NoMinDBSet')] + [System.Nullable[int]] + ${AuditlogMaxSize}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseName}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [securestring] + ${DatabasePassword}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${DatabaseUsername}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ParameterSetName='NoMinDBSet', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MinDBSet', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='NoMinDBSet')] + [Parameter(ParameterSetName='MinDBSet')] + [switch] + ${Sharing}, + + [Parameter(ParameterSetName='MinDBSet', Mandatory=$true)] + [switch] + ${EnableMinDB}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSecurityTokenServiceConfig { + [CmdletBinding(DefaultParameterSetName='SigningCertificateImport', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='SigningCertificateImport')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportSigningCertificate}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${SigningCertificateThumbprint}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${SigningCertificateStoreName}, + + [Parameter(ParameterSetName='SigningCertificateQueue')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${QueueSigningCertificate}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${QueueSigningCertificateThumbprint}, + + [Parameter(ParameterSetName='SigningCertificateReference')] + [string] + ${QueueSigningCertificateStoreName}, + + [Parameter(ParameterSetName='SigningCertificateRevoke')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${RevokeSigningCertificate}, + + [Parameter(ParameterSetName='RevokeSigningCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${RevokeSigningCertificateThumbprint}, + + [Parameter(ParameterSetName='RevokeSigningCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${RevokeSigningCertificateStoreName}, + + [switch] + ${SkipProvisionInstances}, + + [int] + ${ServiceTokenLifetime}, + + [int] + ${ServiceTokenCacheExpirationWindow}, + + [int] + ${FormsTokenLifetime}, + + [int] + ${WindowsTokenLifetime}, + + [int] + ${MaxLogonTokenCacheItems}, + + [int] + ${MaxServiceTokenCacheItems}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServer { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Address')] + [object] + ${Identity}, + + [object] + ${Status}, + + [object] + ${Role}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServerScaleOutDatabaseDataRange { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Database}, + + [Parameter(Mandatory=$true)] + [object] + ${Range}, + + [byte[]] + ${NewRangePoint}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServerScaleOutDatabaseDataSubRange { + [CmdletBinding(DefaultParameterSetName='AttachedDatabase', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AttachedDatabase', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Database}, + + [Parameter(ParameterSetName='UnattachedDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ConnectionString}, + + [Parameter(ParameterSetName='UnattachedDatabase')] + [switch] + ${IsAzureDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Range}, + + [byte[]] + ${SubRangePoint}, + + [Parameter(Mandatory=$true)] + [object] + ${SubRangeMode}, + + [Parameter(Mandatory=$true)] + [bool] + ${IsUpperSubRange}, + + [switch] + ${IgnoreSubRangePointOnBoundary}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${DefaultEndpoint}, + + [ValidateNotNull()] + [object] + ${ServiceApplicationProxyGroup}, + + [ValidateNotNull()] + [object] + ${IisWebServiceApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplicationEndpoint { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='HostName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${HostName}, + + [Parameter(ParameterSetName='ResetHostName', Mandatory=$true)] + [switch] + ${ResetHostName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplicationPool { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Position=1)] + [object] + ${Account}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceApplicationSecurity { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1)] + [ValidateNotNull()] + [object] + ${ObjectSecurity}, + + [switch] + ${Admin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPServiceHostConfig { + [CmdletBinding(DefaultParameterSetName='SslCertificateImport', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='SslCertificateReference', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='SslCertificateImport', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [Alias('Port')] + [ValidateRange(1, 65535)] + [int] + ${HttpPort}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [Parameter(ParameterSetName='SslCertificateImport')] + [Alias('SecurePort')] + [ValidateRange(1, 65535)] + [int] + ${HttpsPort}, + + [Parameter(ParameterSetName='SslCertificateImport')] + [Parameter(ParameterSetName='SslCertificateReference')] + [ValidateRange(1, 65535)] + [int] + ${NetTcpPort}, + + [Parameter(ParameterSetName='SslCertificateReference', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SslCertificateThumbprint}, + + [Parameter(ParameterSetName='SslCertificateReference')] + [ValidateNotNullOrEmpty()] + [string] + ${SslCertificateStoreName}, + + [Parameter(ParameterSetName='SslCertificateImport')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportSslCertificate}, + + [switch] + ${NoWait}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSessionStateService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [System.Nullable[int]] + ${SessionTimeout}, + + [Parameter(ParameterSetName='AdvancedProvision')] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSite { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default')] + [object] + ${OwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${QuotaTemplate}, + + [Parameter(ParameterSetName='Default')] + [object] + ${Template}, + + [Parameter(ParameterSetName='Default')] + [string] + ${Url}, + + [Parameter(ParameterSetName='Default')] + [long] + ${MaxSize}, + + [Parameter(ParameterSetName='Default')] + [long] + ${WarningSize}, + + [Parameter(ParameterSetName='Default')] + [string] + ${SharingType}, + + [Parameter(ParameterSetName='Default')] + [ValidateSet('Unlock','NoAdditions','ReadOnly','NoAccess')] + [string] + ${LockState}, + + [Parameter(ParameterSetName='Default')] + [object] + ${SecondaryOwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [string] + ${UserAccountDirectoryPath}, + + [Parameter(ParameterSetName='SiteSubscription')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='SiteSubscription')] + [switch] + ${Force}, + + [object] + ${AdministrationSiteType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteAdministration { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='Default')] + [object] + ${OwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${SecondaryOwnerAlias}, + + [Parameter(ParameterSetName='Default')] + [object] + ${Template}, + + [Parameter(ParameterSetName='Default')] + [ValidateSet('Unlock','NoAdditions','ReadOnly','NoAccess')] + [string] + ${LockState}, + + [Parameter(ParameterSetName='Default')] + [long] + ${MaxSize}, + + [Parameter(ParameterSetName='Default')] + [long] + ${WarningSize}, + + [Parameter(ParameterSetName='SiteSubscription')] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='SiteSubscription')] + [switch] + ${Force}, + + [object] + ${AdministrationSiteType}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${UserAccountDirectoryPath}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${FeaturePack}, + + [switch] + ${PassThru}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionEdiscoveryHub { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${SearchScope}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionIRMConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${IrmEnabled}, + + [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${CertificateServerUrl}, + + [switch] + ${PassThru}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionMetadataConfig { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ServiceProxy}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${HubUri}, + + [switch] + ${DoNotUnpublishAllPackages}, + + [switch] + ${SyndicationErrorReportEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteSubscriptionProfileConfig { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MySiteSettings', Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${MySiteHostLocation}, + + [Parameter(ParameterSetName='MySiteSettings', ValueFromPipeline=$true)] + [object] + ${MySiteManagedPath}, + + [Parameter(ParameterSetName='MySiteSettings')] + [ValidateSet('None','Resolve','Block')] + [string] + ${SiteNamingConflictResolution}, + + [string] + ${SynchronizationOU}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSiteURL { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${Zone}, + + [Parameter(Mandatory=$true)] + [string] + ${Url}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPStateServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPStateServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [Alias('Application')] + [object] + ${ServiceApplication}, + + [ValidateRange(1, 10)] + [System.Nullable[int]] + ${Weight}, + + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPSubscriptionSettingsServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${FailoverDatabaseServer}, + + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseName}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPThrottlingRule { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNull()] + [object] + ${Criteria}, + + [ValidateRange(0, 10)] + [ValidateNotNull()] + [System.Nullable[int]] + ${Threshold}, + + [ValidateNotNull()] + [System.Nullable[datetime]] + ${Expiration}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Schedule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTopologyServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${LoadBalancerUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTopologyServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${BadListPeriod}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTranslationServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${DatabaseServer}, + + [string] + ${FailoverDatabaseServer}, + + [System.Nullable[int]] + ${TimerJobFrequency}, + + [System.Nullable[int]] + ${MaximumTranslationAttempts}, + + [System.Nullable[int]] + ${KeepAliveTimeout}, + + [System.Nullable[int]] + ${MaximumTranslationTime}, + + [System.Nullable[int]] + ${TranslationsPerInstance}, + + [System.Nullable[int]] + ${MaximumSyncTranslationRequests}, + + [System.Nullable[int]] + ${RecycleProcessThreshold}, + + [System.Nullable[int]] + ${TotalActiveProcesses}, + + [string] + ${MachineTranslationClientId}, + + [string] + ${MachineTranslationCategory}, + + [switch] + ${UseDefaultInternetSettings}, + + [string] + ${WebProxyAddress}, + + [string] + ${MachineTranslationAddress}, + + [System.Nullable[int]] + ${JobExpirationDays}, + + [System.Nullable[int]] + ${MaximumItemsPerDay}, + + [System.Nullable[int]] + ${MaximumItemsPerPartitionPerDay}, + + [System.Nullable[int]] + ${MaximumBinaryFileSize}, + + [System.Nullable[int]] + ${MaximumTextFileSize}, + + [System.Nullable[int]] + ${MaximumWordCharacterCount}, + + [System.Nullable[bool]] + ${DisableBinaryFileScan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string[]] + ${AddEnabledFileExtensions}, + + [string[]] + ${RemoveEnabledFileExtensions}, + + [switch] + ${ClearEnabledFileExtensions}, + + [switch] + ${EnableAllFileExtensions}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTranslationServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [System.Nullable[int]] + ${MaximumGroupSize}, + + [System.Nullable[int]] + ${MaximumItemCount}, + + [switch] + ${DefaultProxyGroup}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTranslationThrottlingSetting { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [System.Nullable[int]] + ${SiteQuota}, + + [System.Nullable[int]] + ${TenantQuota}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedIdentityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='BasicParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${ImportTrustCertificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet', Mandatory=$true)] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [object] + ${ClaimsMappings}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNullOrEmpty()] + [string] + ${SignInUrl}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [object] + ${ClaimProvider}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [string] + ${Realm}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [switch] + ${UseWReply}, + + [Parameter(ParameterSetName='BasicParameterSet')] + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [string] + ${RegisteredIssuerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedRootAuthority { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ParameterSetName='ManualUpdateCertificateParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedSecurityTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [string] + ${RegisteredIssuerName}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [ValidateNotNullOrEmpty()] + [switch] + ${IsTrustBroker}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPTrustedServiceTokenIssuer { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ParameterSetName='ImportCertificateParameterSet')] + [ValidateNotNull()] + [System.Security.Cryptography.X509Certificates.X509Certificate2] + ${Certificate}, + + [Parameter(ParameterSetName='MetadataEndPointParameterSet')] + [ValidateNotNull()] + [uri] + ${MetadataEndPoint}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUsageApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [object] + ${UsageService}, + + [ValidateLength(1, 135)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseName}, + + [ValidateNotNullOrEmpty()] + [ValidateLength(1, 128)] + [string] + ${DatabaseUsername}, + + [ValidateNotNull()] + [securestring] + ${DatabasePassword}, + + [switch] + ${EnableLogging}, + + [ValidateLength(1, 135)] + [string] + ${FailoverDatabaseServer}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUsageDefinition { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Enable}, + + [ValidateRange(0, 31)] + [int] + ${DaysRetained}, + + [ValidateRange(0, 31)] + [int] + ${DaysToKeepUsageFiles}, + + [ValidateRange(1, 9223372036854775807)] + [long] + ${MaxTotalSizeInBytes}, + + [switch] + ${UsageDatabaseEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUsageService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The max space, in GB, that Usage log files should take up.')] + [ValidateRange(1, 20)] + [uint32] + ${UsageLogMaxSpaceGB}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The location where Usage log files are created.')] + [ValidateLength(1, 181)] + [ValidateNotNullOrEmpty()] + [string] + ${UsageLogLocation}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The time interval, in minutes, that Usage log files should be cut and start a new one.')] + [ValidateRange(1, 1440)] + [uint32] + ${UsageLogCutTime}, + + [Parameter(ValueFromPipeline=$true, HelpMessage='The max usage file size, in KB, that Usage log files should be cut and start a new one.')] + [ValidateRange(512, 65536)] + [uint32] + ${UsageLogMaxFileSizeKB}, + + [System.Nullable[bool]] + ${LoggingEnabled}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPUser { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('UserAlias')] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${Web}, + + [object] + ${Group}, + + [string] + ${DisplayName}, + + [switch] + ${SyncFromAD}, + + [string[]] + ${AddPermissionLevel}, + + [string[]] + ${RemovePermissionLevel}, + + [switch] + ${ClearPermissions}, + + [switch] + ${PassThru}, + + [string] + ${Email}, + + [switch] + ${IsSiteCollectionAdmin}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioExternalData { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${UnattendedServiceAccountApplicationID}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioPerformance { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [long] + ${MaxDiagramSize}, + + [Parameter(Mandatory=$true)] + [int] + ${MinDiagramCacheAge}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${MaxDiagramCacheAge}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [int] + ${MaxRecalcDuration}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [long] + ${MaxCacheSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioSafeDataProvider { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${VisioServiceApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DataProviderId}, + + [Parameter(Mandatory=$true)] + [int] + ${DataProviderType}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Description}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPVisioServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${ServiceApplicationPool}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWeb { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${RelativeUrl}, + + [string] + ${Description}, + + [object] + ${Template}, + + [Obsolete('This control applies to SharePoint 2007 theming and is no longer functional')] + [string] + ${Theme}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWebApplication { + [CmdletBinding(DefaultParameterSetName='UpdateGeneralSettings', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='UpdateClaimSettings', Mandatory=$true)] + [object] + ${Zone}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [int] + ${DefaultTimeZone}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [string] + ${DefaultQuotaTemplate}, + + [Parameter(ParameterSetName='UpdateMailSettings', Mandatory=$true)] + [string] + ${SMTPServer}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [switch] + ${DisableSMTPEncryption}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [int] + ${SMTPServerPort}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [string] + ${OutgoingEmailAddress}, + + [Parameter(ParameterSetName='UpdateMailSettings')] + [string] + ${ReplyToEmailAddress}, + + [Parameter(ParameterSetName='UpdateGeneralSettings')] + [Alias('ProxyGroup')] + [object] + ${ServiceApplicationProxyGroup}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${AuthenticationProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${AdditionalClaimProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [string] + ${SignInRedirectURL}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [object] + ${SignInRedirectProvider}, + + [Parameter(ParameterSetName='UpdateClaimSettings')] + [ValidateSet('Kerberos','NTLM')] + [string] + ${AuthenticationMethod}, + + [switch] + ${Force}, + + [switch] + ${NotProvisionGlobally}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWebApplicationHttpThrottlingMonitor { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true, Position=1, ValueFromPipelineByPropertyName=$true)] + [string] + ${Category}, + + [Parameter(Mandatory=$true, Position=2, ValueFromPipelineByPropertyName=$true)] + [string] + ${Counter}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [string] + ${Instance}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Upper')] + [ValidateRange(0, 1.7976931348623157E+308)] + [double] + ${UpperLimit}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Lower')] + [ValidateRange(0, 1.7976931348623157E+308)] + [double] + ${LowerLimit}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [Alias('Buckets')] + [double[]] + ${HealthScoreBuckets}, + + [Parameter(ValueFromPipelineByPropertyName=$true)] + [switch] + ${IsDESC}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWOPIBinding { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [switch] + ${DefaultAction}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWOPIZone { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Zone}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWordConversionServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Low')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [string] + ${DatabaseName}, + + [pscredential] + ${DatabaseCredential}, + + [string] + ${DatabaseServer}, + + [System.Nullable[int]] + ${TimerJobFrequency}, + + [System.Nullable[int]] + ${ConversionTimeout}, + + [System.Nullable[int]] + ${MaximumConversionAttempts}, + + [System.Nullable[int]] + ${KeepAliveTimeout}, + + [System.Nullable[int]] + ${MaximumConversionTime}, + + [System.Nullable[int]] + ${MaximumSyncConversionRequests}, + + [System.Nullable[int]] + ${ConversionsPerInstance}, + + [switch] + ${DisableEmbeddedFonts}, + + [switch] + ${DisableBinaryFileScan}, + + [System.Nullable[int]] + ${RecycleProcessThreshold}, + + [System.Nullable[int]] + ${ActiveProcesses}, + + [System.Nullable[int]] + ${MaximumMemoryUsage}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [string[]] + ${AddSupportedFormats}, + + [string[]] + ${RemoveSupportedFormats}, + + [switch] + ${ClearSupportedFormats}, + + [System.Nullable[int]] + ${MaximumGroupSize}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWorkflowConfig { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='WebApplication', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='SiteCollection', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${SiteCollection}, + + [bool] + ${EmailNoPermissionParticipantsEnabled}, + + [bool] + ${SendDocumentToExternalParticipants}, + + [bool] + ${DeclarativeWorkflowsEnabled}, + + [int] + ${SingleWorkflowEpisodeTimeout}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWorkManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${ApplicationPool}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(HelpMessage='This value specifies the minimum amount of time between refreshes for a provider for a given user.')] + [timespan] + ${MinimumTimeBetweenProviderRefreshes}, + + [Parameter(HelpMessage='This value specifies the minimum amount of time between calls to search for a given user.')] + [timespan] + ${MinimumTimeBetweenSearchQueries}, + + [Parameter(HelpMessage='This value specifies the minimum amount of time between calls into our routine that tries to find new tenants that want to sync EWS tasks.')] + [timespan] + ${MinimumTimeBetweenEwsSyncSubscriptionSearches}, + + [Parameter(HelpMessage='This value specifies the maximum number of users a service instance will try to sync on a given tenant via EWS per Timer job interval')] + [uint32] + ${NumberOfUsersPerEwsSyncBatch}, + + [Parameter(HelpMessage='This value specifies the maximum number of users a service instance machine will sync via EWS at one time across all tenants.')] + [uint32] + ${NumberOfUsersEwsSyncWillProcessAtOnce}, + + [Parameter(HelpMessage='This value specifies the maximum number of tenants the service will try to sync via EWS per Timer job interval')] + [uint32] + ${NumberOfSubscriptionSyncsPerEwsSyncRun}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Set-SPWorkManagementServiceApplicationProxy { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [switch] + ${DefaultProxyGroup}, + + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Split-SPScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='NewDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseName}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseFailoverServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNull()] + [pscredential] + ${NewDatabaseCredentials}, + + [Parameter(ParameterSetName='ExistingDatabase', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TargetDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceServiceApplication}, + + [int] + ${SourcePercentage}, + + [switch] + ${MoveLowerHalf}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Split-SPServerScaleOutDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='NewDatabase', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseName}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNullOrEmpty()] + [string] + ${NewDatabaseFailoverServer}, + + [Parameter(ParameterSetName='NewDatabase')] + [ValidateNotNull()] + [pscredential] + ${NewDatabaseCredentials}, + + [Parameter(ParameterSetName='ExistingDatabase', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${TargetDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [object] + ${SourceServiceApplication}, + + [int] + ${SourcePercentage}, + + [switch] + ${MoveLowerHalf}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPAdminJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPAssignment { + [CmdletBinding()] +param( + [switch] + ${Global}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPContentDeploymentJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [object] + ${Identity}, + + [switch] + ${WaitEnabled}, + + [string] + ${DeploySinceTime}, + + [switch] + ${TestEnabled}, + + [string] + ${UseSpecificSnapshot}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPDiagnosticsSession { + [CmdletBinding()] +param( + [guid] + ${CorrelationId}, + + [switch] + ${Dashboard}, + + [ValidateSet('High','Medium','Monitorable','Unexpected','Verbose','VerboseEx','None')] + [string] + ${TraceLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Start-SPTimerJob { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPAssignment { + [CmdletBinding()] +param( + [switch] + ${Global}, + + [Parameter(Position=0, ValueFromPipeline=$true)] + [object] + ${SemiGlobal}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPDiagnosticsSession { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPDistributedCacheServiceInstance { + [CmdletBinding()] +param( + [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [switch] + ${Graceful}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPEnterpriseSearchServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [ValidateRange(0, 1440)] + [System.Nullable[int]] + ${TimeLeft}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPService { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Stop-SPServiceInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Suspend-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Suspend-SPStateServiceDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [Alias('Name')] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Suspend-SPVideoStreamingAccess { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${SiteSubscription}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Switch-SPSitesToNewDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [guid[]] + ${SiteIds}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${SourceDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DestinationDatabase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DatabaseServer}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Sync-SPProjectPermissions { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='SPMode', Mandatory=$true, Position=0)] + [Parameter(ParameterSetName='PSMode', Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [uri] + ${Url}, + + [Parameter(ParameterSetName='SPMode', Position=1)] + [ValidateSet('Full','Incremental')] + [ValidateNotNullOrEmpty()] + [object] + ${Type}, + + [Parameter(ParameterSetName='PSMode', Position=1)] + [switch] + ${SyncPWASite}, + + [Parameter(ParameterSetName='PSMode', Position=2)] + [switch] + ${SyncProjectSites}, + + [Parameter(ParameterSetName='PSMode', Position=3)] + [switch] + ${Async}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='ContentDatabaseById')] +param( + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [ValidateNotNull()] + [object] + ${ServerInstance}, + + [ValidateNotNull()] + [pscredential] + ${DatabaseCredentials}, + + [switch] + ${ShowRowCounts}, + + [switch] + ${ShowLocation}, + + [Parameter(ParameterSetName='ContentDatabaseById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${ExtendedCheck}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPInfoPathFormTemplate { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [string] + ${Path}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPIPRangeAllowList { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SiteName}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${IP}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPO365LinkSettings { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] + [uri] + ${MySiteHostUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPProjectServiceApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1, ValueFromPipeline=$true)] + [object] + ${Rule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPProjectWebInstance { + [CmdletBinding()] +param( + [Parameter(ParameterSetName='FindProjectSiteByWebInstance', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='FindProjectSiteByWebInstance', Position=1, ValueFromPipeline=$true)] + [object] + ${Rule}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Test-SPSite { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [guid] + ${RuleId}, + + [switch] + ${RunAlways}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPAppInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPDataConnectionFile { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPFeature { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${Force}, + + [int] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPHelpCollection { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${Name}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPSolution { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='OneWebApplication', Mandatory=$true)] + [object] + ${WebApplication}, + + [string] + ${Time}, + + [switch] + ${Local}, + + [Parameter(ParameterSetName='AllWebApplication', Mandatory=$true)] + [switch] + ${AllWebApplications}, + + [uint32] + ${Language}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Uninstall-SPWebPartPack { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [string] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [uint32] + ${Language}, + + [string] + ${CompatibilityLevel}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Unpublish-SPServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPAppCatalogConfiguration { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Site}, + + [switch] + ${SkipWebTemplateChecking}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPAppInstance { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${App}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPAzureBlobConfigLocator { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [byte[]] + ${Locator}) + + + } + + +function Update-SPAzureBlobConfigLocatorEx { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [byte[]] + ${Locator}) + + + } + + +function Update-SPAzureBlobConfigLocatorEx1 { + [CmdletBinding(DefaultParameterSetName='__AllParameterSets')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default')] + [bool] + ${UpdateContentPoolsWithDelay}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [byte[]] + ${Locator}) + + + } + + +function Update-SPAzureBlobLogStoreSignatures { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ReadSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WriteSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ReadSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WriteSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRReadSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRWriteSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRReadSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRWriteSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${PrimaryFarmPoolId}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRFarmPoolId}) + + + } + + +function Update-SPAzureBlobSignaturesEx { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ReadSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WriteSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ReadSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WriteSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRReadSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRWriteSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRReadSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRWriteSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${PrimaryFarmPoolId}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRFarmPoolId}) + + + } + + +function Update-SPAzureBlobSignaturesEx1 { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ReadSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WriteSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${ReadSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${WriteSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRReadSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRWriteSignaturesByPrimaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRReadSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRWriteSignaturesBySecondaryKey}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${PrimaryFarmPoolId}, + + [Parameter(ParameterSetName='default', Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${DRFarmPoolId}, + + [Parameter(ParameterSetName='default')] + [bool] + ${UpdateContentPoolsWithDelay}) + + + } + + +function Update-SPDistributedCacheSize { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] + [uint32] + ${CacheSizeInMB}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPFarmEncryptionKey { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [switch] + ${Resume}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPHelp { + [CmdletBinding()] +param( + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPInfoPathAdminFileUrl { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true)] + [uri] + ${Find}, + + [Parameter(Mandatory=$true)] + [uri] + ${Replace}, + + [switch] + ${Scan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPInfoPathFormTemplate { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPInfoPathUserFileUrl { + [CmdletBinding(DefaultParameterSetName='WebApp', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='WebApp', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDB', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${ContentDatabase}, + + [Parameter(ParameterSetName='Site', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [uri] + ${Find}, + + [Parameter(Mandatory=$true)] + [uri] + ${Replace}, + + [switch] + ${Scan}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPProfilePhotoStore { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${MySiteHostLocation}, + + [bool] + ${CreateThumbnailsForImportedPhotos}, + + [bool] + ${NoDelete}, + + [uri] + ${OldBaseUri}, + + [uri] + ${NewBaseUri}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPRepopulateMicroblogFeedCache { + [CmdletBinding(DefaultParameterSetName='Default')] +param( + [Parameter(ParameterSetName='Default', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='FollowableList', Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true, ValueFromPipeline=$true)] + [Parameter(ParameterSetName='Default', ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${SiteSubscription}, + + [Parameter(ParameterSetName='Default')] + [ValidateNotNull()] + [string] + ${AccountName}, + + [Parameter(ParameterSetName='Default')] + [ValidateNotNull()] + [string] + ${SiteUrl}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${SiteId}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${WebId}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [guid] + ${ListId}, + + [Parameter(ParameterSetName='FollowableList', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${ListRootFolderUrl}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPRepopulateMicroblogLMTCache { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${ProfileServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreApplicationServerKey { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Passphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreCredentialMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${Principal}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [securestring[]] + ${Values}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreGroupCredentialMapping { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [securestring[]] + ${Values}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSecureStoreMasterKey { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Passphrase}, + + [Parameter(Mandatory=$true)] + [ValidateNotNull()] + [object] + ${ServiceApplicationProxy}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [string] + ${LiteralPath}, + + [string] + ${Time}, + + [switch] + ${CASPolicies}, + + [switch] + ${GACDeployment}, + + [switch] + ${FullTrustBinDeployment}, + + [switch] + ${Local}, + + [switch] + ${Force}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPUserSolution { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Mandatory=$true)] + [object] + ${Site}, + + [Parameter(Mandatory=$true)] + [object] + ${ToSolution}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Update-SPWOPIProofKey { + [CmdletBinding()] +param( + [ValidateNotNullOrEmpty()] + [string] + ${ServerName}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPAppManagementServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='AppManagementSvcAppById', Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ParameterSetName='AppManagementSvcAppByName')] + [string] + ${Name}, + + [guid[]] + ${DatabaseIds}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPConfigurationDatabase { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPContentDatabase { + [CmdletBinding(DefaultParameterSetName='ContentDatabaseById', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [object] + ${WebApplication}, + + [Parameter(ParameterSetName='ContentDatabaseByName', Mandatory=$true)] + [ValidateNotNull()] + [string] + ${Name}, + + [ValidateNotNull()] + [object] + ${ServerInstance}, + + [switch] + ${UseSnapshot}, + + [Parameter(ParameterSetName='ContentDatabaseById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(Position=1)] + [switch] + ${ForceDeleteLock}, + + [switch] + ${SkipIntegrityChecks}, + + [switch] + ${NoB2BSiteUpgrade}, + + [switch] + ${AllowUnattached}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPEnterpriseSearchServiceApplication { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPEnterpriseSearchServiceApplicationSiteSettings { + [CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPFarm { + [CmdletBinding(DefaultParameterSetName='FarmById', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [switch] + ${ServerOnly}, + + [switch] + ${SkipDatabaseUpgrade}, + + [switch] + ${NoB2BSiteUpgrade}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPProfileServiceApplication { + [CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNull()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPServer { + [CmdletBinding()] +param( + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPSingleSignOnDatabase { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SSOConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [string] + ${SecureStoreConnectionString}, + + [Parameter(Mandatory=$true)] + [ValidateNotNullOrEmpty()] + [securestring] + ${SecureStorePassphrase}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPSite { + [CmdletBinding(DefaultParameterSetName='SPSiteById', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(ParameterSetName='SPSiteById', Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [object] + ${Identity}, + + [switch] + ${VersionUpgrade}, + + [switch] + ${QueueOnly}, + + [switch] + ${Email}, + + [switch] + ${Unthrottled}, + + [byte] + ${Priority}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPSiteMapDatabase { + [CmdletBinding(DefaultParameterSetName='DefaultSet', SupportsShouldProcess=$true, ConfirmImpact='High')] +param( + [Parameter(Mandatory=$true, Position=0)] + [ValidateNotNullOrEmpty()] + [guid] + ${DatabaseId}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + +function Upgrade-SPWebApplication { + [CmdletBinding()] +param( + [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] + [ValidateNotNullOrEmpty()] + [object] + ${Identity}, + + [Parameter(ValueFromPipeline=$true)] + [object] + ${AssignmentCollection}) + + + } + + + diff --git a/Tests/Tests.pssproj b/Tests/Tests.pssproj index 597acb246..09c494faf 100644 --- a/Tests/Tests.pssproj +++ b/Tests/Tests.pssproj @@ -27,6 +27,11 @@ 4 + + + + + @@ -54,6 +59,10 @@ + + + + diff --git a/Tests/xSharePoint.TestHarness.psm1 b/Tests/xSharePoint.TestHarness.psm1 new file mode 100644 index 000000000..5dcbc4aa0 --- /dev/null +++ b/Tests/xSharePoint.TestHarness.psm1 @@ -0,0 +1,82 @@ +function Invoke-xSharePointTests() { + $repoDir = Join-Path $PSScriptRoot "..\" -Resolve + + $testCoverageFiles = @() + Get-ChildItem "$repoDir\modules\xSharePoint\**\*.psm1" -Recurse | ForEach-Object { $testCoverageFiles += $_.FullName } + + $results = Invoke-Pester -Script @( + @{ + 'Path' = $repoDir + 'Parameters' = @{ + 'SharePointCmdletModule' = (Join-Path $repoDir "\Tests\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1") + } + }, + @{ + 'Path' = $repoDir + 'Parameters' = @{ + 'SharePointCmdletModule' = (Join-Path $repoDir "\Tests\Stubs\SharePoint\16.0.4316.1217\Microsoft.SharePoint.PowerShell.psm1") + } + } + ) -CodeCoverage $testCoverageFiles -PassThru +} + +function Write-xSharePointStubFiles() { + param + ( + [parameter(Mandatory = $true)] [System.String] $SharePointStubPath, + [parameter(Mandatory = $true)] [System.String] $DCacheStubPath + ) + + Add-PSSnapin Microsoft.SharePoint.PowerShell + + $SPStubContent = ((Get-Command | Where-Object { $_.Source -eq "Microsoft.SharePoint.PowerShell" } ) | ForEach-Object -Process { + $signature = $null + $command = $_ + $metadata = New-Object -TypeName System.Management.Automation.CommandMetaData -ArgumentList $command + $definition = [System.Management.Automation.ProxyCommand]::Create($metadata) + foreach ($line in $definition -split "`n") + { + if ($line.Trim() -eq 'begin') + { + break + } + $signature += $line + } + "function $($command.Name) { `n $signature `n } `n" + }) | Out-String + + foreach ($line in $SPStubContent.Split([Environment]::NewLine)) { + $line = $line.Replace("[System.Nullable``1[[Microsoft.Office.Server.Search.Cmdlet.ContentSourceCrawlScheduleType, Microsoft.Office.Server.Search.PowerShell, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]", "[object]") + $line = $line.Replace("[System.Collections.Generic.List``1[[Microsoft.SharePoint.PowerShell.SPUserLicenseMapping, Microsoft.SharePoint.PowerShell, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]", "[object]") + $line = $line -replace "\[System.Nullable\[Microsoft.*]]", "[System.Nullable[object]]" + $line = $line -replace "\[Microsoft.*.\]", "[object]" + + $line | Out-File $SharePointStubPath -Encoding utf8 -Append + } + + + Use-CacheCluster + + $dcacheStubContent = ((Get-Command | Where-Object { $_.Source -match "DistributedCache*" } ) | ForEach-Object -Process { + $signature = $null + $command = $_ + $metadata = New-Object -TypeName System.Management.Automation.CommandMetaData -ArgumentList $command + $definition = [System.Management.Automation.ProxyCommand]::Create($metadata) + foreach ($line in $definition -split "`n") + { + if ($line.Trim() -eq 'begin') + { + break + } + $signature += $line + } + "function $($command.Name) { `n $signature `n } `n" + }) | Out-String + + foreach ($line in $dcacheStubContent.Split([Environment]::NewLine)) { + $line = $line -replace "\[System.Nullable\[Microsoft.*]]", "[System.Nullable[object]]" + $line = $line -replace "\[Microsoft.*.\]", "[object]" + + $line | Out-File $DCacheStubPath -Encoding utf8 -Append + } +} \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 b/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 index d150ecd1c..cfe9684bf 100644 --- a/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.Global.Tests.ps1 @@ -1,10 +1,7 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest @@ -12,34 +9,30 @@ Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path Import-Module "$PSScriptRoot\xSharePoint.TestHelpers.psm1" -Describe 'xSharePoint Global Tests' { +Describe 'xSharePoint whole of module tests' { $mofFiles = @(Get-ChildItem $RepoRoot -Recurse -Filter "*.schema.mof" -File | ? { ($_.FullName -like "*\DscResources\*") }) - Context 'MOF schemas' { + Context "Validate the MOF schemas for the DSC resources" { - It "Don't have InstallAccount as a required parameter" { + It "should not list InstallAccount as required if it does have that attribute" { $mofFilesWithNoInstallAccount = 0 - $mofFiles | % { + $mofFiles | ForEach-Object { $fileHasInstallAccount = $false - Get-Content $_.FullName | % { - if ($_.IndexOf("[Write, EmbeddedInstance(`"MSFT_Credential`")] String InstallAccount;") -gt 0) { $fileHasInstallAccount = $true } - } - if (-not $fileHasInstallAccount -and $_.Name -ne "MSFT_xSPInstall.schema.mof" ` - -and $_.Name -ne "MSFT_xSPClearRemoteSessions.schema.mof" ` - -and $_.Name -ne "MSFT_xSPInstallPrereqs.schema.mof") { + + $mofSchema = Get-MofSchemaObject $_.FullName + $installAccount = $mofSchema.Attributes | Where-Object { $_.Name -eq "InstallAccount" } + if (($null -ne $installAccount) -and ($installAccount.State -eq "Required")) { $mofFilesWithNoInstallAccount += 1 - Write-Warning "File $($_.FullName) does not contain an InstallAccount parameter. All SharePoint specific resources should use this to impersonate as and access SharePoint resources" + Write-Warning "File $($_.FullName) has InstallAccount listed as a required parameter. After v0.6 of xSharePoint this should be changed to 'write' instead of 'required'" } } $mofFilesWithNoInstallAccount | Should Be 0 } - - - It "Has MOF schemas that match properties on PowerShell functions" { + It "uses MOF schemas that match the functions used in the corresponding PowerShell module for each resource" { $filesWithErrors = 0 $WarningPreference = "Continue" $mofFiles | % { @@ -48,18 +41,15 @@ Describe 'xSharePoint Global Tests' { $filesWithErrors | Should Be 0 } } -} -$DSCTestsPath = (Get-Item (Join-Path $RepoRoot "..\**\DSCResource.Tests\MetaFixers.psm1" -Resolve)).FullName -if ($null -ne $DSCTestsPath) { - Import-Module $DSCTestsPath + $DSCTestsPath = (Get-Item (Join-Path $RepoRoot "..\**\DSCResource.Tests\MetaFixers.psm1" -Resolve)).FullName + if ($null -ne $DSCTestsPath) { + Import-Module $DSCTestsPath + Context "Validate the format and structure of all text files in the module" { - Describe 'Text files formatting' { - $allTextFiles = Get-TextFilesList $RepoRoot - - Context 'Files encoding' { + $allTextFiles = Get-TextFilesList $RepoRoot - It "Doesn't use Unicode encoding" { + It "has no files that aren't in UTF-8 encoding" { $unicodeFilesCount = 0 $allTextFiles | %{ if (Test-FileUnicode $_) { @@ -69,11 +59,8 @@ if ($null -ne $DSCTestsPath) { } $unicodeFilesCount | Should Be 0 } - } - - Context 'Indentations' { - It "Uses spaces for indentation, not tabs" { + It "has no files with tabs in the content" { $totalTabsCount = 0 $allTextFiles | %{ $fileName = $_.FullName @@ -86,78 +73,23 @@ if ($null -ne $DSCTestsPath) { } } } -} - - -Describe 'PowerShell Modules' { - - $psm1Files = @(ls $RepoRoot -Recurse -Filter "*.psm1" -File | ? { - ($_.FullName -like "*\DscResources\*" -or $_.FullName -like "*\Modules\xSharePoint.*") -and (-not ($_.Name -like "*.schema.psm1")) - }) - - if (-not $psm1Files) { - Write-Verbose -Verbose "There are no resource files to analyze" - } else { - - Write-Verbose -Verbose "Analyzing $($psm1Files.Count) files" - - Context 'Correctness' { - function Get-ParseErrors - { - param( - [Parameter(ValueFromPipeline=$True,Mandatory=$True)] - [string]$fileName - ) - - $tokens = $null - $errors = $null - $ast = [System.Management.Automation.Language.Parser]::ParseFile($fileName, [ref] $tokens, [ref] $errors) - return $errors - } - - - It 'all .psm1 files don''t have parse errors' { - $errors = @() - $psm1Files | ForEach-Object { - $localErrors = Get-ParseErrors $_.FullName - if ($localErrors) { - Write-Warning "There are parsing errors in $($_.FullName)" - Write-Warning ($localErrors | Format-List | Out-String) - } - $errors += $localErrors - } - $errors.Count | Should Be 0 - } - } - - Context "SharePoint Cmdlet use" { - function Get-SPCmdletCalls - { - param( - [Parameter(ValueFromPipeline=$True,Mandatory=$True)] - [string]$fileName - ) - - $tokens = $null - $errors = $null - $ast = [System.Management.Automation.Language.Parser]::ParseFile($fileName, [ref] $tokens, [ref] $errors) - return $tokens | Where-Object { $_.TokenFlags -contains "CommandName" -and $_.Text -like "*-SP*"} | ft - } - - It "doesn't call SharePoint PowerShell cmdlets directly" { - $tokens = @() - $psm1Files | ForEach-Object { - $localCmdletCalls = Get-SPCmdletCalls $_.FullName - if ($localCmdletCalls) { - Write-Warning "There are calls to SharePoint cmdlets in $($_.FullName) - use Invoke-xSharePointSPCmdlet instead to mock and test these calls" - Write-Warning ($localCmdletCalls | Format-List | Out-String) - } - $tokens += $localCmdletCalls + Context "Validate the PowerShell modules used throughout the module" { + $psm1Files = @(ls $RepoRoot -Recurse -Filter "*.psm1" -File | ? { + ($_.FullName -like "*\DscResources\*" -or $_.FullName -like "*\Modules\xSharePoint.*") -and (-not ($_.Name -like "*.schema.psm1")) + }) + + It 'has valid PowerShell syntax in all module files' { + $errors = @() + $psm1Files | ForEach-Object { + $localErrors = Get-ParseErrors $_.FullName + if ($localErrors) { + Write-Warning "There are parsing errors in $($_.FullName)" + Write-Warning ($localErrors | Format-List | Out-String) } - $tokens.Count | Should Be 0 + $errors += $localErrors } + $errors.Count | Should Be 0 } } -} - +} \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 b/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 index b8cafe9db..0d2001041 100644 --- a/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 +++ b/Tests/xSharePoint/xSharePoint.TestHelpers.psm1 @@ -87,93 +87,107 @@ function Assert-MofSchemaScriptParameters() { $functions = $ast.FindAll( {$args[0] -is [System.Management.Automation.Language.FunctionDefinitionAst]}, $true) $functions | ForEach-Object { - $function = $_ - $astTokens = $null - $astErrors = $null - $functionAst = [System.Management.Automation.Language.Parser]::ParseInput($_.Body, [ref] $astTokens, [ref] $astErrors) + if ($_ -like "*-TargetResource") { + $function = $_ + $astTokens = $null + $astErrors = $null + $functionAst = [System.Management.Automation.Language.Parser]::ParseInput($_.Body, [ref] $astTokens, [ref] $astErrors) - $parameters = $functionAst.FindAll( {$args[0] -is [System.Management.Automation.Language.ParameterAst]}, $true) + $parameters = $functionAst.FindAll( {$args[0] -is [System.Management.Automation.Language.ParameterAst]}, $true) - foreach ($mofParameter in $mofData.Attributes) { - # Check the parameter exists - $paramToCheck = $parameters | Where-Object { $_.Name.ToString() -eq "`$$($mofParameter.Name)" } + foreach ($mofParameter in $mofData.Attributes) { + # Check the parameter exists + $paramToCheck = $parameters | Where-Object { $_.Name.ToString() -eq "`$$($mofParameter.Name)" } - if ($null -eq $paramToCheck) { - $hasErrors = $true - Write-Warning "File $psFile is missing parameter $($mofParameter.Name) from the $($_.Name) method" - } + if ($null -eq $paramToCheck) { + $hasErrors = $true + Write-Warning "File $psFile is missing parameter $($mofParameter.Name) from the $($_.Name) method" + } - $parameterAttribute = $paramToCheck.Attributes | ? { $_.TypeName.ToString() -eq "parameter" } -ErrorAction SilentlyContinue + $parameterAttribute = $paramToCheck.Attributes | ? { $_.TypeName.ToString() -eq "parameter" } -ErrorAction SilentlyContinue - if (($mofParameter.State -eq "Key" -or $mofParameter.State -eq "Required")) { + if (($mofParameter.State -eq "Key" -or $mofParameter.State -eq "Required")) { - if (-not $parameterAttribute) { - $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) that is not marked as mandatory (has no parameter attribute) in the $($function.Name) method" - } else { - $isMandatoryInScript = [bool]::Parse(($parameterAttribute.NamedArguments | ? { $_.ArgumentName -eq "Mandatory" }).Argument.VariablePath.ToString()) - - if ($isMandatoryInScript -eq $false) { + if (-not $parameterAttribute) { $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) that is not marked as mandatory in the $($function.Name) method" + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is not marked as mandatory (has no parameter attribute) in the $($function.Name) method" + } else { + $isMandatoryInScript = [bool]::Parse(($parameterAttribute.NamedArguments | ? { $_.ArgumentName -eq "Mandatory" }).Argument.VariablePath.ToString()) + + if ($isMandatoryInScript -eq $false) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is not marked as mandatory in the $($function.Name) method" + } } } - } - if ($mofParameter.State -eq "Write") { - if ($null -ne $parameterAttribute) { - $isMandatoryInScript = [bool]::Parse(($parameterAttribute.NamedArguments | ? { $_.ArgumentName -eq "Mandatory" }).Argument.VariablePath.ToString()) - if ($isMandatoryInScript -eq $true) { - $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) that is marked as mandatory in the $($function.Name) method and it should not be" + if ($mofParameter.State -eq "Write") { + if ($null -ne $parameterAttribute) { + $isMandatoryInScript = [bool]::Parse(($parameterAttribute.NamedArguments | ? { $_.ArgumentName -eq "Mandatory" }).Argument.VariablePath.ToString()) + if ($isMandatoryInScript -eq $true) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is marked as mandatory in the $($function.Name) method and it should not be" + } } } - } - - if ($null -ne $mofParameter.ValueMap) { - $validateSetAttribute = ($paramToCheck.Attributes | ? { $_.TypeName.ToString() -eq "ValidateSet" }) - - if (-not $validateSetAttribute) { - $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) that is missing a ValidateSet attribute in the $($function.Name) method" - } - $psValidateSetParams = $validateSetAttribute.PositionalArguments | % { $_.Value.ToString() } + if ($null -ne $mofParameter.ValueMap) { + $validateSetAttribute = ($paramToCheck.Attributes | ? { $_.TypeName.ToString() -eq "ValidateSet" }) - $mofParameter.ValueMap | ForEach-Object { - if ($psValidateSetParams -notcontains $_) { + if (-not $validateSetAttribute) { $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) that does not have '$_' in its validateset parameter for $($function.Name) method" + Write-Warning "File $psFile has parameter $($mofParameter.Name) that is missing a ValidateSet attribute in the $($function.Name) method" } - } - $psValidateSetParams | ForEach-Object { - if ($mofParameter.ValueMap -notcontains $_) { - $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) that contains '$_' in the $($function.Name) function which is not in the valuemap in the schema" + $psValidateSetParams = $validateSetAttribute.PositionalArguments | % { $_.Value.ToString() } + + $mofParameter.ValueMap | ForEach-Object { + if ($psValidateSetParams -notcontains $_) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) that does not have '$_' in its validateset parameter for $($function.Name) method" + } } - } - } - if ($mofParameter.EmbeddedInstance -eq $null) { - if (($paramToCheck.Attributes | ? { $_.TypeName.ToString() -match $mofParameter.DataType }) -eq $null) { - $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) in function $($function.Name) that does not match the data type of the schema" - } - } else { - switch ($mofParameter.EmbeddedInstance) { - "MSFT_Credential" { - if (($paramToCheck.Attributes | ? { $_.TypeName.ToString() -match "PSCredential" }) -eq $null) { + $psValidateSetParams | ForEach-Object { + if ($mofParameter.ValueMap -notcontains $_) { $hasErrors = $true - Write-Warning "File $psFile has parameter $($mofParameter.Name) in function $($function.Name) that does not match the data type of the schema" + Write-Warning "File $psFile has parameter $($mofParameter.Name) that contains '$_' in the $($function.Name) function which is not in the valuemap in the schema" } } } - } + + if ($mofParameter.EmbeddedInstance -eq $null) { + if (($paramToCheck.Attributes | ? { $_.TypeName.ToString() -match $mofParameter.DataType }) -eq $null) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) in function $($function.Name) that does not match the data type of the schema" + } + } else { + switch ($mofParameter.EmbeddedInstance) { + "MSFT_Credential" { + if (($paramToCheck.Attributes | ? { $_.TypeName.ToString() -match "PSCredential" }) -eq $null) { + $hasErrors = $true + Write-Warning "File $psFile has parameter $($mofParameter.Name) in function $($function.Name) that does not match the data type of the schema" + } + } + } + } + } } } return (!$hasErrors) } +function Get-ParseErrors { + param( + [Parameter(ValueFromPipeline=$True,Mandatory=$True)] + [string]$fileName + ) + + $tokens = $null + $errors = $null + $ast = [System.Management.Automation.Language.Parser]::ParseFile($fileName, [ref] $tokens, [ref] $errors) + return $errors +} + Export-ModuleMember * \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 b/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 index 9176d93fe..ac91c7392 100644 --- a/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.Util.Tests.ps1 @@ -1,10 +1,7 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 37697f927..f2eafb624 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -1,5 +1,7 @@ [CmdletBinding()] -param() +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 { @@ -10,6 +12,7 @@ $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPBCSServiceApp" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -23,67 +26,76 @@ Describe "xSPBCSServiceApp" { DatabaseServer = "TestServer\Instance" } - Context "Validate get method" { - It "Calls the service application picker with the appropriate type name" { - Mock Get-xSharePointServiceApplication { return @{ - DisplayName = $testParams.Name - ApplicationPool = @{ Name = $testParams.ApplicationPool } - } } -Verifiable -ParameterFilter {$Name -eq $testParams.Name -and $TypeName -eq "BCS"} - - $results = Get-TargetResource @testParams - $results | Should Not BeNullOrEmpty + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + + Context "When no service application exists in the current farm" { - Assert-VerifiableMocks + Mock Get-SPServiceApplication { return $null } + Mock New-SPBusinessDataCatalogServiceApplication { } + + It "returns null from the Get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } } - } - Context "Validate test method" { - It "Fails when no service app exists" { - Mock Get-TargetResource { return @{} } + It "returns false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the service app exists" { - Mock Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = $testParams.ApplicationPool - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when the service app exists but has the wrong app pool" { - Mock Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = "Wrong app pool" - } - } - Test-TargetResource @testParams | Should Be $false + + It "creates a new service application in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPBusinessDataCatalogServiceApplication } } - Context "Validate set method" { - It "Creates a new service application" { - Mock Get-TargetResource { return @{} } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPBusinessDataCatalogServiceApplication" } + Context "When a service application exists and is configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Business Data Connectivity Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } - Set-TargetResource @testParams + It "returns values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } - Assert-VerifiableMocks + It "returns true when the Test method is called" { + Test-TargetResource @testParams | Should Be $true } + } - It "Updates an existing service application" { - Mock Get-TargetResource { return @{ Name = $testParams.Name; ApplicationPool = "Wrong app pool" } } - Mock Get-xSharePointServiceApplication { return @{ + Context "When a service application exists and the app pool is not configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Business Data Connectivity Service Application" DisplayName = $testParams.Name - ApplicationPool = @{ Name = $testParams.ApplicationPool } - } } -Verifiable -ParameterFilter {$Name -eq $testParams.Name -and $TypeName -eq "BCS"} - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.ApplicationPool } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPBusinessDataCatalogServiceApplication" } + ApplicationPool = @{ Name = "Wrong App Pool Name" } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + Mock Get-SPServiceApplicationPool { return @{ Name = $testParams.ApplicationPool } } + Mock Set-SPBusinessDataCatalogServiceApplication { } + + It "returns false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the update service app cmdlet from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Get-SPServiceApplicationPool + Assert-MockCalled Set-SPBusinessDataCatalogServiceApplication -ParameterFilter { $ApplicationPool.Name -eq $testParams.ApplicationPool } } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 index b90843f9e..dc162e3db 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 @@ -1,20 +1,16 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPCacheAccounts" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\Modules\xSharePoint.CacheAccounts\xSharePoint.CacheAccounts.psm1") Describe "xSPCacheAccounts" { InModuleScope $ModuleName { @@ -24,84 +20,104 @@ Describe "xSPCacheAccounts" { SuperReaderAlias = "DEMO\SuperReader" } - Context "Validate get method" { - It "Calls the service application picker with the appropriate type name" { - Mock Invoke-xSharePointSPCmdlet { return @{ - Properties = @{ - SuperUserAlias = $testParams.SuperUserAlias - SuperReaderAlias = $testParams.SuperReaderAlias - } - }} -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } - - $results = Get-TargetResource @testParams - $results.Count | Should Not BeNullOrEmpty + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock Set-xSharePointCacheReaderPolicy {} + Mock Set-xSharePointCacheOwnerPolicy {} + Mock Update-xSharePointObject {} + + Context "The web application specified does not exist" { + Mock Get-SPWebApplication { return $null } - Assert-VerifiableMocks + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when no cache accounts exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the correct accounts are assigned" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - SuperUserAlias = $testParams.SuperUserAlias - SuperReaderAlias = $testParams.SuperReaderAlias - } - } - Test-TargetResource @testParams | Should Be $true + + It "throws and exception where set is called" { + { Set-TargetResource @testParams } | Should Throw } - It "Fails when the wrong super reader is defined" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - SuperUserAlias = $testParams.SuperUserAlias - SuperReaderAlias = "DEMO\WrongUser" - } - } - Test-TargetResource @testParams | Should Be $false + } + + Context "The specified cache accounts have not been configured" { + Mock Get-SPWebApplication { return @{ + Properties = @{ } + }} + + It "returns empty strings from the Get method" { + $results = Get-TargetResource @testParams + $results.SuperUserAlias | Should BeNullOrEmpty + $results.SuperReaderAlias | Should BeNullOrEmpty } - It "Fails when the wrong super user is defined" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - SuperUserAlias = "DEMO\WrongUser" - SuperReaderAlias = $testParams.SuperReaderAlias - } - } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } + + It "Updates the accounts when set is called" { + Set-TargetResource @testParams + + Assert-MockCalled Set-xSharePointCacheReaderPolicy + Assert-MockCalled Set-xSharePointCacheOwnerPolicy + Assert-MockCalled Update-xSharePointObject + } } - Context "Validate set method" { - It "Sets accounts when no existing account is set" { - Mock Invoke-xSharePointSPCmdlet { return @{ - Properties = @{} - } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } - Mock Set-xSharePointCacheReaderPolicy { return $null } -Verifiable - Mock Set-xSharePointCacheOwnerPolicy { return $null } -Verifiable - Mock Update-xSharePointObject { return $null } -Verifiable + Context "The cache accounts have been configured correctly" { + Mock Get-SPWebApplication { return @{ + Properties = @{ + portalsuperuseraccount = $testParams.SuperUserAlias + portalsuperreaderaccount = $testParams.SuperReaderAlias + } + }} - Set-TargetResource @testParams + It "returns the values from the get method" { + $results = Get-TargetResource @testParams + $results.SuperUserAlias | Should Not BeNullOrEmpty + $results.SuperReaderAlias | Should Not BeNullOrEmpty + } - Assert-VerifiableMocks + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } + } + + Context "Cache accounts have been configured, but the reader account is wrong" { + Mock Get-SPWebApplication { return @{ + Properties = @{ + SuperUserAlias = $testParams.SuperUserAlias + SuperReaderAlias = "WRONG\AccountName" + } + }} - It "Sets accounts when existing accounts are set" { - Mock Invoke-xSharePointSPCmdlet { return @{ - Properties = @{ - SuperUserAlias = $testParams.SuperUserAlias - SuperReaderAlias = $testParams.SuperReaderAlias - } - } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } - Mock Set-xSharePointCacheReaderPolicy { return $null } -Verifiable - Mock Set-xSharePointCacheOwnerPolicy { return $null } -Verifiable - Mock Update-xSharePointObject { return $null } -Verifiable + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + It "sets the correct accounts to the web app again" { Set-TargetResource @testParams + Assert-MockCalled Update-xSharePointObject + } + } + + Context "Cache accounts have been configured, but the super account is wrong" { + Mock Get-SPWebApplication { return @{ + Properties = @{ + SuperUserAlias = "WRONG\AccountName" + SuperReaderAlias = $testParams.SuperReaderAlias + } + }} - Assert-VerifiableMocks + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "sets the correct accounts to the web app again" { + Set-TargetResource @testParams + Assert-MockCalled Update-xSharePointObject } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index 5653127e7..38ef599b3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -1,18 +1,15 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPCreateFarm" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPCreateFarm" { @@ -23,101 +20,92 @@ Describe "xSPCreateFarm" { FarmAccount = New-Object System.Management.Automation.PSCredential ("username", (ConvertTo-SecureString "password" -AsPlainText -Force)) Passphrase = "passphrase" AdminContentDatabaseName = "Admin_Content" + CentralAdministrationPort = 1234 } - Context "Validate get method" { - It "Calls SP Farm to find the local environment settings" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter {$CmdletName -eq "Get-SPFarm"} - $results = Get-TargetResource @testParams - Assert-VerifiableMocks - } - } - - Context "Validate test method" { - It "Fails when local server is not in a farm" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } - Test-TargetResource @testParams | Should Be $false - } - It "Passes when local server is in a farm" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - FarmConfigDatabaseName = "SP_Config" - } - } - Test-TargetResource @testParams | Should Be $true - } - } + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPConfigurationDatabase {} + Mock Install-SPHelpCollection {} + Mock Initialize-SPResourceSecurity {} + Mock Install-SPService {} + Mock Install-SPFeature {} + Mock New-SPCentralAdministration {} + Mock Install-SPApplicationContent {} - Context "Validate set method" { - It "Creates a new SharePoint 2016 farm" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPConfigurationDatabase" -and $Arguments.ContainsKey("LocalServerRole") } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPHelpCollection" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Initialize-SPResourceSecurity" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPService" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPFeature" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPCentralAdministration" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPApplicationContent" } + $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName + $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 16 } } + Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = $majorBuildNumber } } - Set-TargetResource @testParams + Context "no farm is configured locally and a supported version of SharePoint is installed" { + Mock Get-SPFarm { return $null } - Assert-VerifiableMocks + It "the get method returns null when the farm is not configured" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - It "Creates a new SharePoint 2013 farm" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPConfigurationDatabase" -and (-not $Arguments.ContainsKey("LocalServerRole")) } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPHelpCollection" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Initialize-SPResourceSecurity" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPService" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPFeature" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPCentralAdministration" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPApplicationContent" } - - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 15 } } + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the appropriate cmdlets in the set method" { Set-TargetResource @testParams - - Assert-VerifiableMocks + switch ($majorBuildNumber) + { + 15 { + Assert-MockCalled New-SPConfigurationDatabase + } + 16 { + Assert-MockCalled New-SPConfigurationDatabase -ParameterFilter { $LocalServerRole -ne $null } + } + Default { + throw [Exception] "A supported version of SharePoint was not used in testing" + } + } + } + } - It "Throws an exception for unsupported SharePoint versions" { - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 1 } } + Context "no farm is configured locally and an unsupported version of SharePoint is installed on the server" { + Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 14 } } + It "throws when an unsupported version is installed and set is called" { { Set-TargetResource @testParams } | Should throw } + } - It "Uses a default port for central admin when none is provided" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPConfigurationDatabase" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPHelpCollection" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Initialize-SPResourceSecurity" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPService" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPFeature" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPCentralAdministration" -and $Arguments.Port -eq 9999 } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPApplicationContent" } - - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 15 } } - - Set-TargetResource @testParams - - Assert-VerifiableMocks + Context "a farm exists locally" { + Mock Get-SPFarm { return @{ + DefaultServiceAccount = @{ Name = $testParams.FarmAccount.UserName } + Name = $testParams.FarmConfigDatabaseName + }} + Mock Get-SPDatabase { return @(@{ + Name = $testParams.FarmConfigDatabaseName + Type = "Configuration Database" + Server = @{ Name = $testParams.DatabaseServer } + })} + Mock Get-SPWebApplication { return @(@{ + IsAdministrationWebApplication = $true + ContentDatabases = @(@{ Name = $testParams.AdminContentDatabaseName }) + Url = "http://$($env:ComputerName):$($testParams.CentralAdministrationPort)" + })} + + It "the get method returns values when the farm is configured" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty } - $testParams.Add("CentralAdministrationPort", 1234) - It "Uses a the specified port for central admin when it is provided" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPConfigurationDatabase" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPHelpCollection" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Initialize-SPResourceSecurity" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPService" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPFeature" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPCentralAdministration" -and $Arguments.Port -eq 1234 } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPApplicationContent" } + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 15 } } + Context "no farm is configured locally, a supported version is installed and no central admin port is specified" { + $testParams.Remove("CentralAdministrationPort") + It "uses a default value for the central admin port" { Set-TargetResource @testParams - - Assert-VerifiableMocks + Assert-MockCalled New-SPCentralAdministration -ParameterFilter { $Port -eq 9999 } } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 index 775cb20b5..e9cbebfe6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 @@ -1,18 +1,16 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPDiagnosticLoggingSettings" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Force +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPDiagnosticLoggingSettings" { InModuleScope $ModuleName { @@ -30,99 +28,117 @@ Describe "xSPDiagnosticLoggingSettings" { ScriptErrorReportingEnabled = $true ScriptErrorReportingRequireAuth = $true ScriptErrorReportingDelay = 5 + EventLogFloodProtectionEnabled = $true + EventLogFloodProtectionThreshold = 10 + EventLogFloodProtectionTriggerPeriod = 5 + EventLogFloodProtectionQuietPeriod = 5 + EventLogFloodProtectionNotifyInterval = 5 } - Context "Validate get method" { - It "Calls the correct function to retrieve settings" { - Mock Invoke-xSharePointSPCmdlet { return @{}} -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPDiagnosticConfig" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + + Context "Diagnostic configuration can not be loaded" { + Mock Get-SPDiagnosticConfig { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails logging settings can not be found" { - Mock Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when logging settings are applied correctly" { - Mock Get-TargetResource { - return @{ - AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled - CustomerExperienceImprovementProgramEnabled = $testParams.CustomerExperienceImprovementProgramEnabled - ErrorReportingEnabled = $testParams.ErrorReportingEnabled - ErrorReportingAutomaticUploadEnabled = $testParams.ErrorReportingAutomaticUploadEnabled - DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled - DaysToKeepLogs = $testParams.DaysToKeepLogs - LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled - LogSpaceInGB = $testParams.LogSpaceInGB - LogPath = $testParams.LogPath - LogCutInterval = $testParams.LogCutInterval - ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled - ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth - ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - InstallAccount = $null - } - } + } + + Context "Diagnostic configuration can be loaded and it is configured correctly" { + Mock Get-SPDiagnosticConfig { return @{ + AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled + CustomerExperienceImprovementProgramEnabled = $testParams.CustomerExperienceImprovementProgramEnabled + ErrorReportingEnabled = $testParams.ErrorReportingEnabled + ErrorReportingAutomaticUploadEnabled = $testParams.ErrorReportingAutomaticUploadEnabled + DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled + DaysToKeepLogs = $testParams.DaysToKeepLogs + LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled + LogDiskSpaceUsageGB = $testParams.LogSpaceInGB + LogLocation = $testParams.LogPath + LogCutInterval = $testParams.LogCutInterval + EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled + EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold + EventLogFloodProtectionTriggerPeriod = $testParams.EventLogFloodProtectionTriggerPeriod + EventLogFloodProtectionQuietPeriod = $testParams.EventLogFloodProtectionQuietPeriod + EventLogFloodProtectionNotifyInterval = $testParams.EventLogFloodProtectionNotifyInterval + ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled + ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth + ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay + } } + + It "return values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { Test-TargetResource @testParams | Should Be $true } - It "Fails when disk location is incorrect" { - Mock Get-TargetResource { - return @{ - AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled - CustomerExperienceImprovementProgramEnabled = $testParams.CustomerExperienceImprovementProgramEnabled - ErrorReportingEnabled = $testParams.ErrorReportingEnabled - ErrorReportingAutomaticUploadEnabled = $testParams.ErrorReportingAutomaticUploadEnabled - DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled - DaysToKeepLogs = $testParams.DaysToKeepLogs - LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled - LogSpaceInGB = $testParams.LogSpaceInGB - LogPath = "C:\logs" - LogCutInterval = $testParams.LogCutInterval - EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled - EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold - EventLogFloodProtectionTriggerPeriod = $testParams.EventLogFloodProtectionTriggerPeriod - EventLogFloodProtectionQuietPeriod = $testParams.EventLogFloodProtectionQuietPeriod - EventLogFloodProtectionNotifyInterval = $testParams.EventLogFloodProtectionNotifyInterval - ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled - ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth - ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - } - } + } + + Context "Diagnostic configuration can be loaded and the log path is not set correctly" { + Mock Get-SPDiagnosticConfig { return @{ + AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled + CustomerExperienceImprovementProgramEnabled = $testParams.CustomerExperienceImprovementProgramEnabled + ErrorReportingEnabled = $testParams.ErrorReportingEnabled + ErrorReportingAutomaticUploadEnabled = $testParams.ErrorReportingAutomaticUploadEnabled + DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled + DaysToKeepLogs = $testParams.DaysToKeepLogs + LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled + LogDiskSpaceUsageGB = $testParams.LogSpaceInGB + LogLocation = "C:\incorrect\value" + LogCutInterval = $testParams.LogCutInterval + EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled + EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold + EventLogFloodProtectionTriggerPeriod = $testParams.EventLogFloodProtectionTriggerPeriod + EventLogFloodProtectionQuietPeriod = $testParams.EventLogFloodProtectionQuietPeriod + EventLogFloodProtectionNotifyInterval = $testParams.EventLogFloodProtectionNotifyInterval + ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled + ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth + ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay + } } + + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Fails when log size is incorrect" { - Mock Get-TargetResource { - return @{ - AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled - CustomerExperienceImprovementProgramEnabled = $testParams.CustomerExperienceImprovementProgramEnabled - ErrorReportingEnabled = $testParams.ErrorReportingEnabled - ErrorReportingAutomaticUploadEnabled = $testParams.ErrorReportingAutomaticUploadEnabled - DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled - DaysToKeepLogs = $testParams.DaysToKeepLogs - LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled - LogSpaceInGB = 1 - LogPath = $testParams.LogPath - LogCutInterval = $testParams.LogCutInterval - EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled - EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold - EventLogFloodProtectionTriggerPeriod = $testParams.EventLogFloodProtectionTriggerPeriod - EventLogFloodProtectionQuietPeriod = $testParams.EventLogFloodProtectionQuietPeriod - EventLogFloodProtectionNotifyInterval = $testParams.EventLogFloodProtectionNotifyInterval - ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled - ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth - ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay - } - } + } + + Context "Diagnostic configuration can be loaded and the log size is not set correctly" { + Mock Get-SPDiagnosticConfig { return @{ + AppAnalyticsAutomaticUploadEnabled = $testParams.AppAnalyticsAutomaticUploadEnabled + CustomerExperienceImprovementProgramEnabled = $testParams.CustomerExperienceImprovementProgramEnabled + ErrorReportingEnabled = $testParams.ErrorReportingEnabled + ErrorReportingAutomaticUploadEnabled = $testParams.ErrorReportingAutomaticUploadEnabled + DownloadErrorReportingUpdatesEnabled = $testParams.DownloadErrorReportingUpdatesEnabled + DaysToKeepLogs = $testParams.DaysToKeepLogs + LogMaxDiskSpaceUsageEnabled = $testParams.LogMaxDiskSpaceUsageEnabled + LogDiskSpaceUsageGB = 1 + LogLocation = $testParams.LogPath + LogCutInterval = $testParams.LogCutInterval + EventLogFloodProtectionEnabled = $testParams.EventLogFloodProtectionEnabled + EventLogFloodProtectionThreshold = $testParams.EventLogFloodProtectionThreshold + EventLogFloodProtectionTriggerPeriod = $testParams.EventLogFloodProtectionTriggerPeriod + EventLogFloodProtectionQuietPeriod = $testParams.EventLogFloodProtectionQuietPeriod + EventLogFloodProtectionNotifyInterval = $testParams.EventLogFloodProtectionNotifyInterval + ScriptErrorReportingEnabled = $testParams.ScriptErrorReportingEnabled + ScriptErrorReportingRequireAuth = $testParams.ScriptErrorReportingRequireAuth + ScriptErrorReportingDelay = $testParams.ScriptErrorReportingDelay + } } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - } - Context "Validate set method" { - It "Calls the correct function to retrieve settings" { - Mock Invoke-xSharePointSPCmdlet { return @{}} -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPDiagnosticConfig" -and $Arguments.ContainsKey("InstallAccount") -eq $false } + It "repairs the diagnostic configuration" { + Mock Set-SPDiagnosticConfig {} Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Set-SPDiagnosticConfig } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 668432a07..8f7eedadb 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -1,19 +1,17 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPDistributedCacheService" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\Modules\xSharePoint.DistributedCache\xSharePoint.DistributedCache.psm1") Describe "xSPDistributedCacheService" { InModuleScope $ModuleName { @@ -21,129 +19,93 @@ Describe "xSPDistributedCacheService" { Name = "AppFabricCache" Ensure = "Present" CacheSizeInMB = 1024 - ServiceAccount = New-Object System.Management.Automation.PSCredential ("username", (ConvertTo-SecureString "password" -AsPlainText -Force)) + ServiceAccount = "DOMAIN\user" CreateFirewallRules = $true } - Context "Validate get method" { - It "Returns local cache settings correctly when it exists" { - Mock Invoke-xSharePointDCCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Use-CacheCluster" } - Mock Invoke-xSharePointDCCmdlet { return @{ - PortNo = 22233 - } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-CacheHost" } - Mock Invoke-xSharePointDCCmdlet { return @{ - HostName = $env:COMPUTERNAME - Port = 22233 - Size = $testParams.CacheSizeInMB - } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-AFCacheHostConfiguration" } - - Mock Get-WmiObject { @{ StartName = $testParams.ServiceAccount.UserName } } -Verifiable - Mock Get-NetFirewallRule { @{} } -Verifiable - - $result = Get-TargetResource @testParams - - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path + Import-Module "$RepoRoot\Tests\Stubs\DistributedCache\DistributedCache.psm1" -WarningAction SilentlyContinue + + Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.DistributedCache" + Mock Use-CacheCluster { } + Mock Get-WmiObject { return @{ StartName = $testParams.ServiceAccount } } + Mock Get-NetFirewallRule { return @{} } + Mock Get-NetFirewallRule { return @{} } -ModuleName "xSharePoint.DistributedCache" + Mock Enable-NetFirewallRule { } -ModuleName "xSharePoint.DistributedCache" + Mock New-NetFirewallRule { } -ModuleName "xSharePoint.DistributedCache" + Mock Disable-NetFirewallRule { } -ModuleName "xSharePoint.DistributedCache" + Mock Add-SPDistributedCacheServiceInstance { } -ModuleName "xSharePoint.DistributedCache" + Mock Update-SPDistributedCacheSize { } -ModuleName "xSharePoint.DistributedCache" + Mock Get-SPManagedAccount { return @{} } -ModuleName "xSharePoint.DistributedCache" + Mock Get-SPFarm { return @{ + Services = @(@{ + Name = "AppFabricCachingService" + ProcessIdentity = @{ ManagedAccount = $null } + }) + } } -ModuleName "xSharePoint.DistributedCache" + Mock Update-xSharePointDistributedCacheService { } -ModuleName "xSharePoint.DistributedCache" + + + Context "Distributed cache is not configured" { + Mock Get-CacheHost { return $null } + + It "returns null from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - It "Returns local cache settings correctly when it does not exist" { - Mock Invoke-xSharePointDCCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Use-CacheCluster" } - Mock Invoke-xSharePointDCCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-CacheHost" } - $result = Get-TargetResource @testParams - - $result | Should BeNullOrEmpty - - Assert-VerifiableMocks - } - } - - Context "Validate test method" { - It "Fails when no cache is present locally but should be" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when cache is present and size is correct" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - CacheSizeInMB = $testParams.CacheSizeInMB - ServiceAccount = $testParams.ServiceAccount.UserName - CreateFirewallRules = $testParams.CreateFirewallRules - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when cache is present but size is not correct" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - CacheSizeInMB = 1 - ServiceAccount = $testParams.ServiceAccount.UserName - CreateFirewallRules = $testParams.CreateFirewallRules - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $false + + It "Sets up the cache correctly" { + Set-TargetResource @testParams + Assert-MockCalled Add-SPDistributedCacheServiceInstance -ModuleName "xSharePoint.DistributedCache" } + } - $testParams.Ensure = "Absent" + Context "Distributed cache is configured correctly and running as required" { + Mock Get-AFCacheHostConfiguration { return @{ + Size = $testParams.CacheSizeInMB + }} + Mock Get-CacheHost { return @{ PortNo = 22233 } } - It "Fails when cache is present but not should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - CacheSizeInMB = $testParams.CacheSizeInMB - ServiceAccount = $testParams.ServiceAccount.UserName - CreateFirewallRules = $testParams.CreateFirewallRules - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $false - } - It "Passes when cache is not present and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - CacheSizeInMB = $testParams.CacheSizeInMB - ServiceAccount = $testParams.ServiceAccount.UserName - CreateFirewallRules = $testParams.CreateFirewallRules - Ensure = "Absent" - } - } + It "returns true from the test method" { Test-TargetResource @testParams | Should Be $true } } - Context "Validate set method" { + Context "Distributed cache is configured but the required firewall rules are not deployed" { + Mock Get-NetFirewallRule { return $null } - $testParams.Ensure = "Present" - - It "Provisions distributed cache locally when is should be present, installing firewall when asked for" { - Mock Enable-xSharePointDCIcmpFireWallRule { return $null } -Verifiable - Mock Enable-xSharePointDCFireWallRule { return $null } -Verifiable - - Mock Add-xSharePointDistributedCacheServer { return $null } -Verifiable -ParameterFilter { $CacheSizeInMB -eq $testParams.CacheSizeInMB } - - Set-TargetResource @testParams - - Assert-VerifiableMocks + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false } - $testParams.CreateFirewallRules = $false - - It "Provisions distributed cache locally when is should be present, not installing firewall" { - Mock Add-xSharePointDistributedCacheServer { return $null } -Verifiable -ParameterFilter { $CacheSizeInMB -eq $testParams.CacheSizeInMB } - + It "shuts down the distributed cache service" { Set-TargetResource @testParams - - Assert-VerifiableMocks + Assert-MockCalled Enable-NetFirewallRule -ModuleName "xSharePoint.DistributedCache" } + } + Context "Distributed cache is confgured but should not be running on this machine" { $testParams.Ensure = "Absent" + Mock Get-AFCacheHostConfiguration { return @{ + Size = $testParams.CacheSizeInMB + }} + Mock Get-CacheHost { return @{ PortNo = 22233 } } + Mock Remove-xSharePointDistributedCacheServer { } + Mock Get-NetFirewallRule { return @{} } -ModuleName "xSharePoint.DistributedCache" + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } - It "Removes distributed cache locally when is should not be present" { - Mock Remove-xSharePointDistributedCacheServer { return $null } -Verifiable -ParameterFilter { $CacheSizeInMB -eq $testParams.CacheSizeInMB } - Mock Disable-xSharePointDCFireWallRule { return $null } -Verifiable - + It "shuts down the distributed cache service" { Set-TargetResource @testParams - - Assert-VerifiableMocks + Assert-MockCalled Remove-xSharePointDistributedCacheServer + Assert-MockCalled Disable-NetFirewallRule -ModuleName "xSharePoint.DistributedCache" } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index ce4a166b3..3a0ea039a 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -1,5 +1,7 @@ [CmdletBinding()] -param() +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 { @@ -10,6 +12,7 @@ $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPFeature" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -23,164 +26,121 @@ Describe "xSPFeature" { Ensure = "Present" } - Context "Validate get method" { - It "Returns as empty where a feature is not installed in the farm" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 1 } + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock Enable-SPFeature {} + Mock Disable-SPFeature {} - Get-TargetResource @testParams + Context "A feature that is not installed in the farm should be turned on" { + Mock Get-SPFeature { return $null } -ParameterFilter { $Farm -ne $true } - Assert-VerifiableMocks + It "returns null from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - It "Returns a disabled state when an installed feature is not found at a farm scope" { - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.Name } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 1 } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 2 } - $result = Get-TargetResource @testParams + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + } - $result.Ensure | Should be "Absent" + Context "A farm scoped feature is not enabled and should be" { + Mock Get-SPFeature { return $null } -ParameterFilter { $Farm -eq $true } + $testParams.FeatureScope = "Farm" - Assert-VerifiableMocks + It "returns null from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - $testParams.FeatureScope = "Site" - It "Returns a disabled state when an installed feature is not found at a site scope" { - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.Name } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 1 } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 2 } - $result = Get-TargetResource @testParams + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } - $result.Ensure | Should be "Absent" + It "enables the feature in the set method" { + Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Enable-SPFeature } - It "Returns an enabled state when an installed feature is found at a site scope" { - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.Name } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 1 } - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.Name } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 2 } - - $result = Get-TargetResource @testParams + } - $result.Ensure | Should be "Present" + Context "A site collection scoped feature is not enabled and should be" { + Mock Get-SPFeature { return $null } -ParameterFilter { $Site -eq $true } + $testParams.FeatureScope = "Site" - Assert-VerifiableMocks + It "returns null from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - $testParams.FeatureScope = "Farm" - It "Returns an enabled state when an installed feature is found at a farm scope" { - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.Name } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 1 } - Mock Invoke-xSharePointSPCmdlet { return @{ Name = $testParams.Name } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPFeature" -and $Arguments.Count -eq 2 } - $result = Get-TargetResource @testParams + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } - $result.Ensure | Should be "Present" + It "enables the feature in the set method" { + Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Enable-SPFeature } } - Context "Validate test method" { - It "Passes when a farm feature is enabaled and should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $true + Context "A farm scoped feature is enabled and should not be" { + Mock Get-SPFeature { return @{} } + Mock Get-SPFeature { return @{} } -ParameterFilter { $Farm -eq $true } + $testParams.FeatureScope = "Farm" + $testParams.Ensure = "Absent" + + It "returns null from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" } - It "Fails when a farm feature is not enabaled and should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Absent" - } - } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - $testParams.Ensure = "Absent" + It "enables the feature in the set method" { + Set-TargetResource @testParams - It "Passes when a farm feature is not enabaled and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Absent" - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when a farm feature is enabaled and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $false + Assert-MockCalled Disable-SPFeature } + } - $testParams.Ensure = "Present" + Context "A site collection scoped feature is enabled and should not be" { + Mock Get-SPFeature { return @{} } + Mock Get-SPFeature { return @{} } -ParameterFilter { $Site -eq $true } $testParams.FeatureScope = "Site" - It "Passes when a site feature is enabaled and should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $true + It "returns null from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" } - It "Fails when a site feature is not enabaled and should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Absent" - } - } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - $testParams.Ensure = "Absent" + It "enables the feature in the set method" { + Set-TargetResource @testParams - It "Passes when a site feature is not enabaled and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Absent" - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when a site feature is enabaled and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $false + Assert-MockCalled Disable-SPFeature } } - Context "Validate set method" { - + Context "A farm scoped feature is enabled and should be" { + Mock Get-SPFeature { return @{} } + Mock Get-SPFeature { return @{} } -ParameterFilter { $Farm -eq $true } + $testParams.FeatureScope = "Farm" $testParams.Ensure = "Present" - It "Enables a feature that should be on" { - Mock Invoke-xSharePointSPCmdlet { return $false } -Verifiable -ParameterFilter { $CmdletName -eq "Enable-SPFeature" } - - Set-TargetResource @testParams - - Assert-VerifiableMocks + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } + } - $testParams.Ensure = "Absent" - - It "Disables a feature that should be turned off" { - Mock Invoke-xSharePointSPCmdlet { return $false } -Verifiable -ParameterFilter { $CmdletName -eq "Disable-SPFeature" } - - Set-TargetResource @testParams + Context "A site collection scoped feature is enabled and should be" { + Mock Get-SPFeature { return @{} } + Mock Get-SPFeature { return @{} } -ParameterFilter { $Site -eq $testParams.Url } + $testParams.FeatureScope = "Site" - Assert-VerifiableMocks + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } - } + } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index dff6e1289..b224206fb 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -1,10 +1,7 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest @@ -22,79 +19,59 @@ Describe "xSPInstall" { Ensure = "Present" } - Context "Validate get method" { + Context "SharePoint binaries are not installed but should be" { + Mock Get-CimInstance { return $null } - It "Returns false when SharePoint is not detected" { - Mock Get-CimInstance { return $null } -Verifiable - $result = Get-TargetResource @testParams - Assert-VerifiableMocks + It "returns absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - It "Returns true when SharePoint is detected" { - Mock Get-CimInstance { return @{} } -Verifiable - $result = Get-TargetResource @testParams - Assert-VerifiableMocks + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false } } - Context "Validate test method" { - It "Passes when SharePoint is installed" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - BinaryDir = $testParams.BinaryDir - ProductKey = $testParams.ProductKey - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when SharePoint is not installed" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - BinaryDir = $null - ProductKey = $testParams.ProductKey - Ensure = "Absent" - } - } - Test-TargetResource @testParams | Should Be $false + Context "SharePoint binaries are installed and should be" { + Mock Get-CimInstance { return @{} } + + It "returns present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" } - $testParams.Ensure = "Absent" - It "Throws an error if SharePoint should be absent" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - BinaryDir = $null - ProductKey = $testParams.ProductKey - Ensure = "Absent" - } - } - { Test-TargetResource @testParams } | Should Throw + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } - $testParams.Ensure = "Present" } - Context "Validate set method" { - It "Reboots the server after a successful install" { - Mock Start-Process { @{ ExitCode = 0 }} -Verifiable + Context "SharePoint installation executes as expected" { + Mock Start-Process { @{ ExitCode = 0 }} + It "reboots the server after a successful installation" { Set-TargetResource @testParams - $global:DSCMachineStatus | Should Be 1 - - Assert-VerifiableMocks } - It "Throws an error on unknown exit code" { - Mock Start-Process { @{ ExitCode = -1 }} -Verifiable + } + + Context "SharePoint installation fails" { + Mock Start-Process { @{ ExitCode = -1 }} + It "throws an exception on an unknown exit code" { { Set-TargetResource @testParams } | Should Throw + } + } - Assert-VerifiableMocks + $testParams.Ensure = "Absent" + + Context "SharePoint binaries are installed and should not be" { + Mock Get-CimInstance { return @{} } + + It "throws in the test method because uninstall is unsupported" { + { Test-TargetResource @testParams } | Should Throw } - $testParams.Ensure = "Absent" - It "Throws an error when SharePoint should be absent" { + + It "throws in the set method because uninstall is unsupported" { { Set-TargetResource @testParams } | Should Throw } - $testParams.Ensure = "Present" } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index ca9511ac6..ccbf690e8 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPInstallPrereqs" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -22,92 +20,110 @@ Describe "xSPInstallPrereqs" { Ensure = "Present" } - Context "Validate get method" { - It "Checks windows features as well as installed products" { - Mock Get-xSharePointAssemblyVersion { return 16 } -Verifiable - Mock Invoke-Command { return $null } -Verifiable -ParameterFilter { $ScriptBlock.ToString().Contains("Get-WindowsFeature") -eq $true } - Mock Get-CimInstance { return @{} } -Verifiable + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName + $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) - Get-TargetResource @testParams + Mock Get-xSharePointAssemblyVersion { return $majorBuildNumber } + Mock Check-xSharePointInstalledProductRegistryKey { return $null } - Assert-VerifiableMocks - } - } + Context "Prerequisites are not installed but should be" { + Mock Invoke-Command { @( @{ Name = "ExampleFeature"; Installed = $false}) } -ParameterFilter { $ScriptBlock.ToString().Contains("Get-WindowsFeature") -eq $true } + Mock Get-CimInstance { return @() } + Mock Get-ChildItem { return $null } - Context "Validate test method" { - It "Passes when all Prereqs are installed" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - InstallerPath = "C:\SPInstall" - OnlineMode = $true - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $true + It "returns absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - It "Fails when there are Prereqs missing" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - InstallerPath = "C:\SPInstall" - OnlineMode = $true - Ensure = "Absent" - } - } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - $testParams.Ensure = "Absent" - It "Throws an error if SharePoint prereqs should be absent" { - { Test-TargetResource @testParams } | Should Throw + + It "Calls the prerequisite installer from the set method and records the need for a reboot" { + Mock Start-Process { return @{ ExitCode = 3010 } } + + Set-TargetResource @testParams + Assert-MockCalled Start-Process } - $testParams.Ensure = "Present" - } - Context "Validate set method" { - It "Runs the installer and exists after success" { - Mock Get-xSharePointAssemblyVersion { return 15 } - Mock Start-Process { return @{ ExitCode = 0 } } -Verifiable + It "Calls the prerequisite installer from the set method and a pending reboot is preventing it from running" { + Mock Start-Process { return @{ ExitCode = 1001 } } + + Set-TargetResource @testParams + Assert-MockCalled Start-Process + } + + It "Calls the prerequisite installer from the set method and passes a successful installation" { + Mock Start-Process { return @{ ExitCode = 0 } } + Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Start-Process } - It "Detects errors in the installer" { - Mock Get-xSharePointAssemblyVersion { return 15 } + It "Calls the prerequisite installer from the set method when the prerequisite installer is already running" { Mock Start-Process { return @{ ExitCode = 1 } } - { Set-TargetResource @testParams } | Should throw "already running" - + + { Set-TargetResource @testParams } | Should Throw "already running" + } + + It "Calls the prerequisite installer from the set method and invalid arguments are passed to the installer" { Mock Start-Process { return @{ ExitCode = 2 } } - { Set-TargetResource @testParams } | Should throw "Invalid command line parameters" - Mock Start-Process { return @{ ExitCode = -1 } } - { Set-TargetResource @testParams } | Should throw "unknown exit code" + { Set-TargetResource @testParams } | Should Throw "Invalid command line parameters" } - It "Detects reboot conditions in the installer" { - Mock Get-xSharePointAssemblyVersion { return 15 } + It "Calls the prerequisite installer from the set method and throws for unknown error codes" { + Mock Start-Process { return @{ ExitCode = -1 } } - $global:DSCMachineStatus = 0 - Mock Start-Process { return @{ ExitCode = 1001 } } - Set-TargetResource @testParams - $global:DSCMachineStatus | Should Be 1 - - $global:DSCMachineStatus = 0 - Mock Start-Process { return @{ ExitCode = 3010 } } - Set-TargetResource @testParams - $global:DSCMachineStatus | Should Be 1 + { Set-TargetResource @testParams } | Should Throw "unknown exit code" } + } - $testParams.OnlineMode = $false - It "Throws an error if offline mode is run without prerequisite location parameters" { - Mock Get-xSharePointAssemblyVersion { return 15 } + Context "Prerequisites are installed and should be" { + Mock Invoke-Command { return @( @{ Name = "ExampleFeature"; Installed = $true }) } -ParameterFilter { $ScriptBlock.ToString().Contains("Get-WindowsFeature") -eq $true } + if ($majorBuildNumber -eq 15) { + Mock Get-CimInstance { return @( + @{ Name = "Microsoft CCR and DSS Runtime 2008 R3"} + @{ Name = "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"} + @{ Name = "AppFabric 1.1 for Windows Server"} + @{ Name = "WCF Data Services 5.6.0 Runtime"} + @{ Name = "WCF Data Services 5.0 (for OData v3) Primary Components"} + @{ Name = "Microsoft SQL Server 2008 R2 Native Client"} + @{ Name = "Active Directory Rights Management Services Client 2.0"} + )} + } + if ($majorBuildNumber -eq 16) { + Mock Get-CimInstance { return @( + @{ Name = "Microsoft CCR and DSS Runtime 2008 R3"} + @{ Name = "Microsoft Sync Framework Runtime v1.0 SP1 (x64)"} + @{ Name = "AppFabric 1.1 for Windows Server"} + @{ Name = "WCF Data Services 5.6.0 Runtime"} + @{ Name = "Microsoft ODBC Driver 11 for SQL Server"} + @{ Name = "Microsoft Visual C++ 2013 x64 Minimum Runtime - 12.0.21005"} + @{ Name = "Microsoft Visual C++ 2013 x64 Additional Runtime - 12.0.21005"} + @{ Name = "Microsoft SQL Server 2012 Native Client"} + @{ Name = "Active Directory Rights Management Services Client 2.1"} + )} + } + Mock Get-ChildItem { return $null } + Mock Check-xSharePointInstalledProductRegistryKey { return @( @{Example = $true } ) } + + It "returns present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } - { Set-TargetResource @testParams } | Should throw "offline mode" + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } + } + Context "Prerequisites are installed but should not be" { $testParams.Ensure = "Absent" - It "Throws an error if SharePoint prereqs should be absent" { - { Set-TargetResource @testParams } | Should Throw + + It "throws an exception from the set method" { + {Set-TargetResource @testParams} | Should Throw } - $testParams.Ensure = "Present" } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 index 2600e602c..b91bf63c3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPJoinFarm" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -22,71 +20,79 @@ Describe "xSPJoinFarm" { Passphrase = "passphrase" } - Context "Validate get method" { - It "Calls SP Farm to find the local environment settings" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter {$CmdletName -eq "Get-SPFarm"} - $results = Get-TargetResource @testParams - Assert-VerifiableMocks - } - } + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock Connect-SPConfigurationDatabase {} + Mock Install-SPHelpCollection {} + Mock Initialize-SPResourceSecurity {} + Mock Install-SPService {} + Mock Install-SPFeature {} + Mock New-SPCentralAdministration {} + Mock Install-SPApplicationContent {} + Mock Start-Service {} + Mock Invoke-Command {} -ParameterFilter { $ScriptBlock.ToString().Contains("Start-Sleep") -eq $true } - Context "Validate test method" { - It "Fails when local server is not in a farm" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } - Test-TargetResource @testParams | Should Be $false - } - It "Passes when local server is in a farm" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - FarmConfigDatabaseName = "SP_Config" - } - } - Test-TargetResource @testParams | Should Be $true - } - } + $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName + $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) - Context "Validate set method" { - It "Joins a new SharePoint 2016 farm" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Connect-SPConfigurationDatabase" -and $Arguments.ContainsKey("LocalServerRole") } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPHelpCollection" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Initialize-SPResourceSecurity" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPService" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPFeature" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPApplicationContent" } + Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = $majorBuildNumber } } - Mock Invoke-Command { return $null } - Mock Start-Service { return $null } -Verifiable - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 16 } } + Context "no farm is configured locally and a supported version of SharePoint is installed" { + Mock Get-SPFarm { return $null } - Set-TargetResource @testParams - - Assert-VerifiableMocks + It "the get method returns null when the farm is not configured" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - It "Joins a new SharePoint 2013 farm" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Connect-SPConfigurationDatabase" -and (-not $Arguments.ContainsKey("LocalServerRole")) } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPHelpCollection" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Initialize-SPResourceSecurity" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPService" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPFeature" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Install-SPApplicationContent" } - - Mock Invoke-Command { return $null } - Mock Start-Service { return $null } -Verifiable - - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 15 } } + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the appropriate cmdlets in the set method" { Set-TargetResource @testParams - - Assert-VerifiableMocks + switch ($majorBuildNumber) + { + 15 { + Assert-MockCalled Connect-SPConfigurationDatabase + } + 16 { + Assert-MockCalled Connect-SPConfigurationDatabase -ParameterFilter { $LocalServerRole -ne $null } + } + Default { + throw [Exception] "A supported version of SharePoint was not used in testing" + } + } + } + } - It "Throws an exception for unsupported SharePoint versions" { - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 1 } } + Context "no farm is configured locally and an unsupported version of SharePoint is installed on the server" { + Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = 14 } } + It "throws when an unsupported version is installed and set is called" { { Set-TargetResource @testParams } | Should throw } } + + Context "a farm exists locally" { + Mock Get-SPFarm { return @{ + DefaultServiceAccount = @{ Name = $testParams.FarmAccount.UserName } + Name = $testParams.FarmConfigDatabaseName + }} + Mock Get-SPDatabase { return @(@{ + Name = $testParams.FarmConfigDatabaseName + Type = "Configuration Database" + Server = @{ Name = $testParams.DatabaseServer } + })} + + It "the get method returns values when the farm is configured" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } } } \ No newline at end of file diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 index 350029685..24a679b4a 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 @@ -1,18 +1,15 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPManagedAccount" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPManagedAccount" { @@ -25,76 +22,74 @@ Describe "xSPManagedAccount" { AccountName = "username" } - Context "Validate get method" { - It "Calls the service application picker with the appropriate type name" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPManagedAccount" -and $Arguments.Identity -eq $testParams.Account.UserName } - - $results = Get-TargetResource @testParams + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPManagedAccount { } + Mock Set-SPManagedAccount { } + + Context "The specified managed account does not exist in the farm" { + Mock Get-SPManagedAccount { return $null } - Assert-VerifiableMocks + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when managed account does not exist in the farm" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the account exists and has correct settings" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - AccountName = $testParams.AccountName - EmailNotification = $testParams.EmailNotification - PreExpireDays = $testParams.PreExpireDays - Schedule = $testParams.Schedule - } - } - Test-TargetResource @testParams | Should Be $true + + It "calls the new and set methods from the set function" { + Set-TargetResource @testParams + Assert-MockCalled New-SPManagedAccount + Assert-MockCalled Set-SPManagedAccount } - It "Fails when the account exists and the schedule doesnt match" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - AccountName = $testParams.AccountName - EmailNotification = $testParams.EmailNotification - PreExpireDays = $testParams.PreExpireDays - Schedule = "Weekly Friday between 01:00 and 02:00" - } - } + } + + Context "The specified managed account exists but has an incorrect schedule" { + Mock Get-SPManagedAccount { return @{ + Username = $testParams.AccountName + DaysBeforeChangeToEmail = $testParams.EmailNotification + DaysBeforeExpiryToChange = $testParams.PreExpireDays + ChangeSchedule = "wrong schedule" + }} + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Fails when the account exists and the email settings dont match" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - AccountName = $testParams.AccountName - EmailNotification = 0 - PreExpireDays = 0 - Schedule = $testParams.Schedule - } - } - Test-TargetResource @testParams | Should Be $false + + It "calls the set methods from the set function" { + Set-TargetResource @testParams + Assert-MockCalled Set-SPManagedAccount } } - Context "Validate set method" { - It "Creates a new account when none exists" { - Mock Get-TargetResource { return @{} } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPManagedAccount" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPManagedAccount" } + Context "The specified managed account exists but has incorrect notifcation settings" { + Mock Get-SPManagedAccount { return @{ + Username = $testParams.AccountName + DaysBeforeChangeToEmail = 0 + DaysBeforeExpiryToChange = 0 + ChangeSchedule = $testParams.Schedule + }} - Set-TargetResource @testParams - - Assert-VerifiableMocks + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false } - It "Modifies an existing account where it already exists" { - Mock Get-TargetResource { return @{} - AccountName = $testParams.Account.UserName - Schedule = $testParams.Schedule - } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPManagedAccount" } + } - Set-TargetResource @testParams + Context "The specified managed account exists and is configured correctly" { + Mock Get-SPManagedAccount { return @{ + Username = $testParams.AccountName + DaysBeforeChangeToEmail = $testParams.EmailNotification + DaysBeforeExpiryToChange = $testParams.PreExpireDays + ChangeSchedule = $testParams.Schedule + }} - Assert-VerifiableMocks + It "returns the current values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 index 099bfa164..85dd3fd64 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 @@ -1,18 +1,15 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPManagedMetaDataServiceApp" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\Modules\xSharePoint.Util\xSharePoint.Util.psm1") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPManagedMetaDataServiceApp" { @@ -24,59 +21,76 @@ Describe "xSPManagedMetaDataServiceApp" { DatabaseName = "SP_MMS" } - Context "Validate get method" { - It "Retrieves the data from SharePoint" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + + Context "When no service application exists in the current farm" { + + Mock Get-SPServiceApplication { return $null } + Mock New-SPMetadataServiceApplication { } + + It "returns null from the Get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } } - } - Context "Validate test method" { - It "Fails when MMS service app doesn't exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the app exists and uses the correct app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = $testParams.ApplicationPool - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when the app exists but uses the wrong app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = "wrong pool" - } - } - Test-TargetResource @testParams | Should Be $false + + It "creates a new service application in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPMetadataServiceApplication } } - Context "Validate set method" { - It "Creates a new service app where none exists" { - Mock Get-TargetResource { return @{} } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPMetadataServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPMetadataServiceApplicationProxy" } + Context "When a service application exists and is configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Managed Metadata Service" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } - Set-TargetResource @testParams + It "returns values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } - Assert-VerifiableMocks + It "returns true when the Test method is called" { + Test-TargetResource @testParams | Should Be $true } + } - It "Updates an existing service app" { - Mock Get-TargetResource { return @{ ApplicationPool = "Invalid"} } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPMetadataServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" } + Context "When a service application exists and the app pool is not configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Managed Metadata Service" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = "Wrong App Pool Name" } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + Mock Get-SPServiceApplicationPool { return @{ Name = $testParams.ApplicationPool } } + Mock Set-SPMetadataServiceApplication { } + + It "returns false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the update service app cmdlet from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Get-SPServiceApplicationPool + Assert-MockCalled Set-SPMetadataServiceApplication -ParameterFilter { $ApplicationPool.Name -eq $testParams.ApplicationPool } } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 index a73f3f4bc..38331a592 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPManagedPath" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -23,58 +21,59 @@ Describe "xSPManagedPath" { HostHeader = $false } - Context "Validate get method" { - It "Calls the data from SharePoint" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPManagedPath" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPManagedPath { } + + Context "The managed path does not exist and should" { + Mock Get-SPManagedPath { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when path is not found" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the path is found and is the correct type" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - RelativeUrl = $testParams.RelativeUrl - Explicit = $testParams.Explicit - HostHeader = $testParams.HostHeader - WebAppUrl = $testParams.WebAppUrl - } - } - Test-TargetResource @testParams | Should Be $true + + It "creates a host header path in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled New-SPManagedPath } - It "Fails when the path is found and is not the correct type" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - RelativeUrl = $testParams.RelativeUrl - Explicit = (-not $testParams.Explicit) - HostHeader = $testParams.HostHeader - WebAppUrl = $testParams.WebAppUrl - } - } + + $testParams.HostHeader = $true + It "creates a host header path in the set method" { + Set-TargetResource @testParams + + Assert-MockCalled New-SPManagedPath + } + $testParams.HostHeader = $false + } + + Context "The path exists but is of the wrong type" { + Mock Get-SPManagedPath { return @{ + Name = $testParams.RelativeUrl + Type = "ExplicitInclusion" + } } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } } - Context "Validate set method" { - It "Creates a new web application managed path" { - Mock Get-TargetResource { return $null } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPManagedPath" -and $Arguments.WebApplication -eq $testParams.WebAppUrl } - Set-TargetResource @testParams - Assert-VerifiableMocks + Context "The path exists and is the correct type" { + Mock Get-SPManagedPath { return @{ + Name = $testParams.RelativeUrl + Type = "WildcardInclusion" + } } + + It "returns results from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty } - - $testParams.HostHeader = $true - It "Creates a new host header managed path" { - Mock Get-TargetResource { return $null } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPManagedPath" -and $Arguments.HostHeader -eq $true } - Set-TargetResource @testParams - Assert-VerifiableMocks + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 index d0368a2b6..6cfb0f037 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPSearchServiceApp" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -21,61 +19,81 @@ Describe "xSPSearchServiceApp" { ApplicationPool = "SharePoint Search Services" } - Context "Validate get method" { - It "Retrieves the data from SharePoint" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + + Context "When no service application exists in the current farm" { + + Mock Get-SPServiceApplication { return $null } + Mock Get-SPEnterpriseSearchServiceInstance { return @{} } + Mock New-SPBusinessDataCatalogServiceApplication { } + Mock Start-SPEnterpriseSearchServiceInstance { } + Mock New-SPEnterpriseSearchServiceApplication { return @{} } + Mock New-SPEnterpriseSearchServiceApplicationProxy { } + Mock Set-SPEnterpriseSearchServiceApplication { } + + It "returns null from the Get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } } - } - Context "Validate test method" { - It "Fails when service app is not found" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the path is found and is the correct type" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = $testParams.ApplicationPool - } - } - Test-TargetResource @testParams | Should Be $true + + It "creates a new service application in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPEnterpriseSearchServiceApplication } - It "Fails when the service app is found but uses the wrong app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = "Wrong App Pool" + } + + Context "When a service application exists and is configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Search Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } } - } - Test-TargetResource @testParams | Should Be $false + }) } - } - Context "Validate set method" { - It "Creates a new service app where none exists" { - Mock Get-TargetResource { return @{} } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPEnterpriseSearchServiceInstance" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Start-SPEnterpriseSearchServiceInstance" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPEnterpriseSearchServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPEnterpriseSearchServiceApplicationProxy" } + It "returns values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } - Set-TargetResource @testParams + It "returns true when the Test method is called" { + Test-TargetResource @testParams | Should Be $true + } + } - Assert-VerifiableMocks + Context "When a service application exists and the app pool is not configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Search Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = "Wrong App Pool Name" } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) } + Mock Get-SPServiceApplicationPool { return @{ Name = $testParams.ApplicationPool } } + Mock Set-SPEnterpriseSearchServiceApplication { } - It "Updates an existing service app" { - Mock Get-TargetResource { return @{ ApplicationPool = "Invalid"} } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPEnterpriseSearchServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" } + It "returns false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the update service app cmdlet from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Get-SPServiceApplicationPool + Assert-MockCalled Set-SPEnterpriseSearchServiceApplication } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 index 284fe5657..8722f4bc6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPSecureStoreServiceApp" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -22,59 +20,82 @@ Describe "xSPSecureStoreServiceApp" { AuditingEnabled = $false } - Context "Validate get method" { - It "Retrieves the data from SharePoint" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + + $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName + $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) + + Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = $majorBuildNumber } } + + Context "When no service application exists in the current farm" { + + Mock Get-SPServiceApplication { return $null } + Mock New-SPSecureStoreServiceApplication { } + Mock New-SPSecureStoreServiceApplicationProxy { } + + It "returns null from the Get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } } - } - Context "Validate test method" { - It "Fails when service app is not found" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the path is found and is the correct type" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = $testParams.ApplicationPool - } - } - Test-TargetResource @testParams | Should Be $true + + It "creates a new service application in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPSecureStoreServiceApplication } - It "Fails when the service app is found but uses the wrong app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = "Wrong App Pool" + } + + Context "When a service application exists and is configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Secure Store Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } } - } - Test-TargetResource @testParams | Should Be $false + }) } - } - Context "Validate set method" { - It "Creates a new service app where none exists" { - Mock Get-TargetResource { return @{} } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPSecureStoreServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPSecureStoreServiceApplicationProxy" } + It "returns values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } - Set-TargetResource @testParams + It "returns true when the Test method is called" { + Test-TargetResource @testParams | Should Be $true + } + } - Assert-VerifiableMocks + Context "When a service application exists and the app pool is not configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Secure Store Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = "Wrong App Pool Name" } + Database = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) } + Mock Get-SPServiceApplicationPool { return @{ Name = $testParams.ApplicationPool } } + Mock Set-SPSecureStoreServiceApplication { } - It "Updates an existing service app" { - Mock Get-TargetResource { return @{ ApplicationPool = "Invalid"} } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPSecureStoreServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" } + It "returns false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the update service app cmdlet from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Get-SPServiceApplicationPool + Assert-MockCalled Set-SPSecureStoreServiceApplication } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 index e15a63fd9..ee02b76c6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPServiceAppPool" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -21,54 +19,59 @@ Describe "xSPServiceAppPool" { ServiceAccount = "DEMO\svcSPServiceApps" } - Context "Validate get method" { - It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" -and $Arguments.Identity -eq $testParams.Name } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + + Mock New-SPServiceApplicationPool { } + Mock Set-SPServiceApplicationPool { } + + Context "A service account pool does not exist but should" { + Mock Get-SPServiceApplicationPool { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when service app pool is not found" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the pool exists and has the correct service account" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ServiceAccount = $testParams.ServiceAccount - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when the service app pool is found but uses the wrong service account" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ServiceAccount = "Wrong account name" - } - } - Test-TargetResource @testParams | Should Be $false + + It "calls the set method to create a new service account pool" { + Set-TargetResource @testParams + + Assert-MockCalled New-SPServiceApplicationPool } } - Context "Validate set method" { - It "Creates a new service app pool when none exists" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" -and $Arguments.Identity -eq $testParams.Name } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPServiceApplicationPool" -and $Arguments.Name -eq $testParams.Name } + Context "A service account pool exists but has the wrong service account" { + Mock Get-SPServiceApplicationPool { return @{ + Name = $testParams.Name + ProcessAccountName = "WRONG\account" + }} + + It "returns false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the set method to update the service account pool" { Set-TargetResource @testParams - Assert-VerifiableMocks + + Assert-MockCalled Set-SPServiceApplicationPool } + } - It "Updates the service account of the pool when it is wrong" { - Mock Invoke-xSharePointSPCmdlet { return @{ ProcessAccountName = "wrong name" } } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplicationPool" -and $Arguments.Identity -eq $testParams.Name } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPServiceApplicationPool" } + Context "A service account pool exists and uses the correct account" { + Mock Get-SPServiceApplicationPool { return @{ + Name = $testParams.Name + ProcessAccountName = $testParams.ServiceAccount + }} - Set-TargetResource @testParams - Assert-VerifiableMocks + It "retrieves the status from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 index 612c9b64b..31d6f079c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPServiceInstance" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -21,80 +19,106 @@ Describe "xSPServiceInstance" { Ensure = "Present" } - Context "Validate get method" { - It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceInstance" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock Start-SPServiceInstance { } + Mock Stop-SPServiceInstance { } + + Context "The service instance is not running but should be" { + Mock Get-SPServiceInstance { return @( + @{ + TypeName = $testParams.Name + Status = "Disabled" + }) + } + + It "returns absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - } - Context "Validate test method" { - It "Fails when service instance is not found at all" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the set method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the service instance is running and it should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Present" - } - } + + It "calls the start service call from the set method" { + Set-TargetResource @testParams + + Assert-MockCalled Start-SPServiceInstance + } + } + + Context "The service instance is running and should be" { + Mock Get-SPServiceInstance { return @( + @{ + TypeName = $testParams.Name + Status = "Online" + }) + } + + It "returns present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "returns true from the test method" { Test-TargetResource @testParams | Should Be $true } - It "Fails when the service instance isn't running and it should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Absent" - } - } - Test-TargetResource @testParams | Should Be $false + } + + Context "An invalid service application is specified to start" { + Mock Get-SPServiceInstance { return $null } + + It "throws when the set method is called" { + { Set-TargetResource @testParams } | Should Throw } + } - $testParams.Ensure = "Absent" + $testParams.Ensure = "Absent" - It "Fails when the service instance is running and it should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $false + Context "The service instance is not running and should not be" { + Mock Get-SPServiceInstance { return @( + @{ + TypeName = $testParams.Name + Status = "Disabled" + }) } - It "Passes when the service instance isn't running and it should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - Ensure = "Absent" - } - } + + It "returns absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" + } + + It "returns true from the test method" { Test-TargetResource @testParams | Should Be $true } } - Context "Validate set method" { + Context "The service instance is running and should not be" { + Mock Get-SPServiceInstance { return @( + @{ + TypeName = $testParams.Name + Status = "Online" + }) + } - $testParams.Ensure = "Present" + It "returns present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } - It "Starts a service that should be running" { - Mock Invoke-xSharePointSPCmdlet { return @( @{ TypeName = $testParams.Name } ) } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceInstance" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Start-SPServiceInstance" } + It "returns false from the set method" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the stop service call from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks - } - $testParams.Ensure = "Absent" + Assert-MockCalled Stop-SPServiceInstance + } + } - It "Stops a service that should be stopped" { - Mock Invoke-xSharePointSPCmdlet { return @( @{ TypeName = $testParams.Name } ) } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceInstance" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Stop-SPServiceInstance" } + Context "An invalid service application is specified to stop" { + Mock Get-SPServiceInstance { return $null } - Set-TargetResource @testParams - Assert-VerifiableMocks + It "throws when the set method is called" { + { Set-TargetResource @testParams } | Should Throw } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 index 88a5af60d..921d1c797 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPSite" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -21,36 +19,86 @@ Describe "xSPSite" { OwnerAlias = "DEMO\User" } - Context "Validate get method" { - It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPSite" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPSite { } + + Context "The site doesn't exist yet and should" { + Mock Get-SPSite { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when site collection isn't found" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the site collection is found" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Url = $testParams.Url - OwnerAlias = $testParams.OwnerAlias - } - } + + It "creates a new site from the set method" { + Set-TargetResource @testParams + + Assert-MockCalled New-SPSite + } + } + + Context "The site exists and is a host named site collection" { + Mock Get-SPSite { return @{ + HostHeaderIsSiteName = $true + WebApplication = @{ + Url = $testParams.Url + UseClaimsAuthentication = $false + } + Url = $testParams.Url + Owner = @{ UserLogin = "DEMO\owner" } + }} + + It "returns the site data from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { Test-TargetResource @testParams | Should Be $true } } - Context "Validate set method" { - It "Creates a new site when none exists" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPSite" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPSite" } - Set-TargetResource @testParams - Assert-VerifiableMocks + Context "The site exists and uses claims authentication" { + Mock Get-SPSite { return @{ + HostHeaderIsSiteName = $false + WebApplication = @{ + Url = $testParams.Url + UseClaimsAuthentication = $true + } + Url = $testParams.Url + Owner = @{ UserLogin = "DEMO\owner" } + }} + Mock New-SPClaimsPrincipal { return @{ Value = $testParams.OwnerAlias }} + + It "returns the site data from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "The site exists and uses classic authentication" { + Mock Get-SPSite { return @{ + HostHeaderIsSiteName = $false + WebApplication = @{ + Url = $testParams.Url + UseClaimsAuthentication = $false + } + Url = $testParams.Url + Owner = @{ UserLogin = "DEMO\owner" } + }} + + It "returns the site data from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 index d3d862acf..8a2e60caa 100644 --- a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPStateServiceApp" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -18,40 +16,42 @@ Describe "xSPStateServiceApp" { InModuleScope $ModuleName { $testParams = @{ Name = "State Service App" + DatabaseName = "SP_StateService" } - Context "Validate get method" { - It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPStateServiceApplication" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPStateServiceDatabase { return @{} } + Mock New-SPStateServiceApplication { return @{} } + Mock New-SPStateServiceApplicationProxy { return @{} } + + Context "the service app doesn't exist and should" { + Mock Get-SPStateServiceApplication { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when state service app doesn't exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the get method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the state service app exists" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - } - } - Test-TargetResource @testParams | Should Be $true + + It "creates a state service app from the set method" { + Set-TargetResource @testParams + + Assert-MockCalled New-SPStateServiceApplication } } - Context "Validate set method" { - It "Creates a new service app where none exists" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPStateServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPStateServiceDatabase" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPStateServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPStateServiceApplicationProxy" } + Context "the service app exists and should" { + Mock Get-SPStateServiceApplication { return @{ DisplayName = $testParams.Name } } - Set-TargetResource @testParams - Assert-VerifiableMocks + It "returns the current info from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 index 888990102..e666757cc 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 @@ -1,16 +1,14 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path - +$Global:CurrentSharePointStubModule = $SharePointCmdletModule + $ModuleName = "MSFT_xSPUserProfileServiceApp" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -22,68 +20,67 @@ Describe "xSPUserProfileServiceApp" { FarmAccount = New-Object System.Management.Automation.PSCredential ("domain\username", (ConvertTo-SecureString "password" -AsPlainText -Force)) } - Context "Validate get method" { - It "Retrieves the data from SharePoint" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Get-TargetResource @testParams - Assert-VerifiableMocks - } - } - - Context "Validate test method" { - It "Fails when user profile service app doesn't exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } - Test-TargetResource @testParams | Should Be $false + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock Get-UserProfileServiceProperties { return @{ + ProfileDatabase = @{ + Name = "SP_ProfileDB" + Server = @{ Name = "SQL.domain.local" } } - It "Passes when the user profile service app exists and uses the correct app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = $testParams.ApplicationPool - } - } - Test-TargetResource @testParams | Should Be $true + SocialDatabase = @{ + Name = "SP_SocialDB" + Server = @{ Name = "SQL.domain.local" } } - It "Fails when the user profile service app exists but uses the wrong app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = "wrong pool" - } - } - Test-TargetResource @testParams | Should Be $false + SynchronizationDatabase = @{ + Name = "SP_SyncDB" + Server = @{ Name = "SQL.domain.local" } } - } + }} + Mock Get-SPFarm { return @{ + DefaultServiceAccount = @{ Name = $testParams.FarmAccount.Username } + }} + Mock New-SPProfileServiceApplication { } + Mock New-SPProfileServiceApplicationProxy { } + Mock Add-xSharePointUserToLocalAdmin { } + Mock Test-xSharePointUserIsLocalAdmin { return $false } + Mock Remove-xSharePointUserToLocalAdmin { } + Mock New-PSSession { return $null } -ModuleName "xSharePoint.Util" - Context "Validate set method" { - It "Creates a new service app where none exists, adding user to the local admin group" { - Mock Test-xSharePointUserIsLocalAdmin { return $false } -Verifiable - Mock Add-xSharePointUserToLocalAdmin -Verifiable - Mock Remove-xSharePointUserToLocalAdmin -Verifiable + Context "When no service application exists in the current farm" { - Mock New-PSSession { return $null } -ModuleName "xSharePoint.Util" - - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPProfileServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPProfileServiceApplicationProxy" } + Mock Get-SPServiceApplication { return $null } - Set-TargetResource @testParams + It "returns null from the Get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } - Assert-VerifiableMocks + It "returns false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false } - It "Creates a new service app where none exists, without adding user to the local admin group" { - Mock Test-xSharePointUserIsLocalAdmin { return $true } -Verifiable - - Mock New-PSSession { return $null } -ModuleName "xSharePoint.Util" + It "creates a new service application in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPProfileServiceApplication + } + } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPProfileServiceApplication" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPProfileServiceApplicationProxy" } + Context "When a service application exists and is configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "User Profile Service Application" + DisplayName = $testParams.Name + ApplicationPool = @{ Name = $testParams.ApplicationPool } + }) + } - Set-TargetResource @testParams + It "returns values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } - Assert-VerifiableMocks + It "returns true when the Test method is called" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index 340653a36..5e42c1d43 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPUserProfileSyncService" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -22,106 +20,130 @@ Describe "xSPUserProfileSyncService" { Ensure = "Present" } - Context "Validate get method" { - It "Retrieves the data from SharePoint" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceInstance" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock Get-SPFarm { return @{ + DefaultServiceAccount = @{ Name = $testParams.FarmAccount.Username } + }} + Mock Start-SPServiceInstance { } + Mock Stop-SPServiceInstance { } + Mock Restart-Service { } + Mock Add-xSharePointUserToLocalAdmin { } + Mock Test-xSharePointUserIsLocalAdmin { return $false } + Mock Remove-xSharePointUserToLocalAdmin { } + Mock New-PSSession { return $null } -ModuleName "xSharePoint.Util" + + Context "User profile sync service is not running and should be" { + Mock Get-SPServiceInstance { if ($Global:xSharePointUPACheck -eq $false) { + $Global:xSharePointUPACheck = $true + return @( @{ + Status = "Disabled" + ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f") + UserProfileApplicationGuid = [Guid]::Empty + TypeName = "User Profile Synchronization Service" + }) + } else { + return @( @{ + Status = "Online" + ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f") + UserProfileApplicationGuid = [Guid]::NewGuid() + TypeName = "User Profile Synchronization Service" + }) + } + } + + It "returns absent from the get method" { + $Global:xSharePointUPACheck = $false + (Get-TargetResource @testParams).Ensure | Should Be "Absent" } - } - Context "Validate test method" { - It "Fails when user profile sync service doesn't exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } - Test-TargetResource @testParams | Should Be $false - } - It "Passes when the user profile sync service is running and should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $true - } - It "Fails when the user profile sync service is not running and should be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Ensure = "Absent" - } - } + It "returns false from the test method" { + $Global:xSharePointUPACheck = $false Test-TargetResource @testParams | Should Be $false } - $testParams.Ensure = "Absent" + It "calls the start service cmdlet from the set method" { + $Global:xSharePointUPACheck = $false + Mock Set-xSharePointUserProfileSyncMachine { } + Set-TargetResource @testParams - It "Fails when the user profile sync service is running and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Ensure = "Present" - } - } - Test-TargetResource @testParams | Should Be $false - } - It "Passes when the user profile sync service is not running and should not be" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Ensure = "Absent" - } - } - Test-TargetResource @testParams | Should Be $true + Assert-MockCalled Start-SPServiceInstance } } - $testParams.Ensure = "Present" - $Global:xSharePointUPACheck = $false - - Context "Validate set method" { - It "Povisions the user profile sync service where it should be running" { - Mock Test-xSharePointUserIsLocalAdmin { return $false } -Verifiable - Mock Add-xSharePointUserToLocalAdmin -Verifiable - Mock Remove-xSharePointUserToLocalAdmin -Verifiable - - Mock New-PSSession { return $null } -ModuleName "xSharePoint.Util" - Mock Restart-Service { return $null } - - Mock Set-xSharePointUserProfileSyncMachine { return $null } -Verifiable - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Start-SPServiceInstance" } - Mock Invoke-xSharePointSPCmdlet { if ($Global:xSharePointUPACheck -eq $false) { - $Global:xSharePointUPACheck = $true - return @( @{ Status = "Offline"; ID = [Guid]::NewGuid(); TypeName = "User Profile Synchronization Service" }) - } else { - return @( @{ Status = "Online"; ID = [Guid]::NewGuid(); TypeName = "User Profile Synchronization Service" }) - } - } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceInstance" } - - Set-TargetResource @testParams + Context "User profile sync service is running and should be" { + Mock Get-SPServiceInstance { return @( @{ + Status = "Online" + ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f") + UserProfileApplicationGuid = [Guid]::NewGuid() + TypeName = "User Profile Synchronization Service" + }) + } + + It "returns present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } - Assert-VerifiableMocks + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } + } - $testParams.Ensure = "Absent" - $Global:xSharePointUPACheck = $false + $testParams.Ensure = "Absent" + + Context "User profile sync service is running and shouldn't be" { + Mock Get-SPServiceInstance { if ($Global:xSharePointUPACheck -eq $false) { + $Global:xSharePointUPACheck = $true + return @( @{ + Status = "Online" + ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f") + UserProfileApplicationGuid = [Guid]::NewGuid() + TypeName = "User Profile Synchronization Service" + }) + } else { + return @( @{ + Status = "Disabled" + ID = [Guid]::Empty + UserProfileApplicationGuid = [Guid]::Empty + TypeName = "User Profile Synchronization Service" + }) + } + } + + It "returns present from the get method" { + $Global:xSharePointUPACheck = $false + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } - It "Stops the user profile sync service where it should not be running" { - Mock Test-xSharePointUserIsLocalAdmin { return $false } -Verifiable - Mock Add-xSharePointUserToLocalAdmin -Verifiable - Mock Remove-xSharePointUserToLocalAdmin -Verifiable + It "returns false from the test method" { + $Global:xSharePointUPACheck = $false + Test-TargetResource @testParams | Should Be $false + } - Mock New-PSSession { return $null } -ModuleName "xSharePoint.Util" - Mock Restart-Service { return $null } + It "calls the start service cmdlet from the set method" { + $Global:xSharePointUPACheck = $false + Mock Set-xSharePointUserProfileSyncMachine { } -ModuleName "xSharePoint.UserProfileService" + Set-TargetResource @testParams - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Stop-SPServiceInstance" } - Mock Invoke-xSharePointSPCmdlet { if ($Global:xSharePointUPACheck -eq $false) { - $Global:xSharePointUPACheck = $true - return @( @{ Status = "Online"; ID = [Guid]::NewGuid(); TypeName = "User Profile Synchronization Service" }) - } else { - return @( @{ Status = "Disabled"; ID = [Guid]::NewGuid(); TypeName = "User Profile Synchronization Service" }) - } - } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceInstance" } + Assert-MockCalled Stop-SPServiceInstance + } + } - Set-TargetResource @testParams + Context "User profile sync service is not running and shouldn't be" { + Mock Get-SPServiceInstance { return @( @{ + Status = "Disabled" + ID = [Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f") + UserProfileApplicationGuid = [Guid]::Empty + TypeName = "User Profile Synchronization Service" + }) + } + + It "returns absent from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Absent" + } - Assert-VerifiableMocks + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 index df4bc81f0..9afd4a661 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPWebApplication" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -21,50 +19,79 @@ Describe "xSPWebApplication" { ApplicationPool = "SharePoint Web Apps" ApplicationPoolAccount = "DEMO\ServiceAccount" Url = "http://sites.sharepoint.com" + AuthenticationMethod = "NTLM" } - Context "Validate get method" { - It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPAuthenticationProvider { } + Mock New-SPWebApplication { } + + Context "The web application that uses NTLM doesn't exist but should" { + Mock Get-SPWebApplication { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty } - } - Context "Validate test method" { - It "Fails when web app doesn't exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the web app exists and has correct settings" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = $testParams.ApplicationPool - ApplicationPoolAccount = $testParams.ApplicationPoolAccount - } - } - Test-TargetResource @testParams | Should Be $true + + It "calls the new cmdlet from the set method" { + Set-TargetResource @testParams + + Assert-MockCalled New-SPWebApplication + Assert-MockCalled New-SPAuthenticationProvider -ParameterFilter { $DisableKerberos -eq $true } } - It "Fails when the web app exists and has the wrong app pool" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - ApplicationPool = "Wrong app pool" - ApplicationPoolAccount = $testParams.ApplicationPoolAccount - } - } + } + + $testParams.AuthenticationMethod = "Kerberos" + + Context "The web application that uses Kerberos doesn't exist but should" { + Mock Get-SPWebApplication { return $null } + + It "returns null from the get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + } + + It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false } - } - Context "Validate set method" { - It "Creates a new site when none exists" { - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPAuthenticationProvider" } - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPWebApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPWebApplication" } + It "calls the new cmdlet from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks + + Assert-MockCalled New-SPWebApplication + } + } + + Context "The web appliation does exist and should" { + Mock Get-SPAuthenticationProvider { return @{ DisableKerberos = $true; AllowAnonymous = $false } } + Mock Get-SPWebApplication { return @(@{ + DisplayName = $testParams.Name + ApplicationPool = @{ + Name = $testParams.ApplicationPool + Username = $testParams.ApplicationPoolAccount + } + ContentDatabases = @( + @{ + Name = "SP_Content_01" + Server = "sql.domain.local" + } + ) + IisSettings = @( + @{ Path = "C:\inetpub\wwwroot\something" } + ) + Url = $testParams.Url + })} + + It "returns the current data from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + } + + It "returns true from the test method" { + Test-TargetResource @testParams | Should Be $true } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 index b9affd5e6..4826fc22b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 @@ -1,15 +1,13 @@ [CmdletBinding()] -param() - -if (!$PSScriptRoot) # $PSScriptRoot is not defined in 2.0 -{ - $PSScriptRoot = [System.IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path) -} +param( + [string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve) +) $ErrorActionPreference = 'stop' Set-StrictMode -Version latest $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path +$Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPUsageApplication" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") @@ -24,85 +22,113 @@ Describe "xSPUsageApplication" { UsageLogMaxSpaceGB = 10 } - Context "Validate get method" { - It "Calls the right functions to retrieve SharePoint data" { - Mock Invoke-xSharePointSPCmdlet { return @(@{ TypeName = "Usage and Health Data Collection Service Application" }) } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } -ModuleName "xSharePoint.ServiceApplications" - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPUsageService" } - Get-TargetResource @testParams - Assert-VerifiableMocks + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Initialize-xSharePointPSSnapin { } + Mock New-SPUsageApplication { } + Mock Set-SPUsageService { } + Mock Get-SPUsageService { return @{ + UsageLogCutTime = $testParams.UsageLogCutTime + UsageLogDir = $testParams.UsageLogLocation + UsageLogMaxFileSize = ($testParams.UsageLogMaxFileSizeKB * 1024) + UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB + }} + + Context "When no service application exists in the current farm" { + + Mock Get-SPServiceApplication { return $null } + + It "returns null from the Get method" { + Get-TargetResource @testParams | Should BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } } - } - Context "Validate test method" { - It "Fails when state service app doesn't exist" { - Mock -ModuleName $ModuleName Get-TargetResource { return @{} } + It "returns false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } - It "Passes when the state service app exists and settings are corrent" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogLocation = $testParams.UsageLogLocation - UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB - UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB - } - } + + It "creates a new service application in the set method" { + Set-TargetResource @testParams + Assert-MockCalled New-SPUsageApplication + } + } + + Context "When a service application exists and is configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Usage and Health Data Collection Service Application" + DisplayName = $testParams.Name + UsageDatabase = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + + It "returns values from the get method" { + Get-TargetResource @testParams | Should Not BeNullOrEmpty + Assert-MockCalled Get-SPServiceApplication -ParameterFilter { $Name -eq $testParams.Name } + } + + It "returns true when the Test method is called" { Test-TargetResource @testParams | Should Be $true } - It "Fails when the state service app exists and settings are wrong" { - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogLocation = "C:\WrongPath" - UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB - UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB - } - } - Test-TargetResource @testParams | Should Be $false - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - UsageLogCutTime = 0 - UsageLogLocation = $testParams.UsageLogLocation - UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB - UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB - } - } - Test-TargetResource @testParams | Should Be $false - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogLocation = $testParams.UsageLogLocation - UsageLogMaxFileSizeKB = 0 - UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB - } - } - Test-TargetResource @testParams | Should Be $false - Mock -ModuleName $ModuleName Get-TargetResource { - return @{ - Name = $testParams.Name - UsageLogCutTime = $testParams.UsageLogCutTime - UsageLogLocation = $testParams.UsageLogLocation - UsageLogMaxFileSizeKB = $testParams.UsageLogMaxFileSizeKB - UsageLogMaxSpaceGB = 0 - } - } + } + + Context "When a service application exists and log path are not configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Usage and Health Data Collection Service Application" + DisplayName = $testParams.Name + UsageDatabase = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + Mock Get-SPUsageService { return @{ + UsageLogCutTime = $testParams.UsageLogCutTime + UsageLogDir = "C:\Wrong\Location" + UsageLogMaxFileSize = ($testParams.UsageLogMaxFileSizeKB * 1024) + UsageLogMaxSpaceGB = $testParams.UsageLogMaxSpaceGB + }} + + It "returns false when the Test method is called" { Test-TargetResource @testParams | Should Be $false } + + It "calls the update service app cmdlet from the set method" { + Set-TargetResource @testParams + + Assert-MockCalled Set-SPUsageService + } } - Context "Validate set method" { - It "Sets the usage values correctly" { - Mock Invoke-xSharePointSPCmdlet { return $null } -Verifiable -ParameterFilter { $CmdletName -eq "Get-SPServiceApplication" -and $Arguments.Name -eq $testParams.Name } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "New-SPUsageApplication" } - Mock Invoke-xSharePointSPCmdlet { return @{} } -Verifiable -ParameterFilter { $CmdletName -eq "Set-SPUsageService" } + Context "When a service application exists and log size is not configured correctly" { + Mock Get-SPServiceApplication { + return @(@{ + TypeName = "Usage and Health Data Collection Service Application" + DisplayName = $testParams.Name + UsageDatabase = @{ + Name = $testParams.DatabaseName + Server = @{ Name = $testParams.DatabaseServer } + } + }) + } + Mock Get-SPUsageService { return @{ + UsageLogCutTime = $testParams.UsageLogCutTime + UsageLogDir = $testParams.UsageLogLocation + UsageLogMaxFileSize = ($testParams.UsageLogMaxFileSizeKB * 1024) + UsageLogMaxSpaceGB = 1 + }} + + It "returns false when the Test method is called" { + Test-TargetResource @testParams | Should Be $false + } + It "calls the update service app cmdlet from the set method" { Set-TargetResource @testParams - Assert-VerifiableMocks + Assert-MockCalled Set-SPUsageService } } } From 8cc37c0c6ee96f37b2e7106915650e215a3444b8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 00:29:20 +1000 Subject: [PATCH 46/69] Fixed URI generation --- .../DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 | 2 +- .../MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 2914acc59..c039da403 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -43,7 +43,7 @@ function Get-TargetResource InstallAccount = $params.InstallAccount Passphrase = $params.Passphrase AdminContentDatabaseName = $centralAdminSite.ContentDatabases[0].Name - CentralAdministrationPort = [Uri]::new($centralAdminSite.Url).Port + CentralAdministrationPort = (New-Object System.Uri $centralAdminSite.Url).Port } return $returnValue } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index e61dc48a5..a4e29c115 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -39,9 +39,9 @@ function Get-TargetResource AllowAnonymous = $authProvider.AllowAnonymous DatabaseName = $wa.ContentDatabases[0].Name DatabaseServer = $wa.ContentDatabases[0].Server - HostHeader = [Uri]::New($wa.Url).Host + HostHeader = (New-Object System.Uri $wa.Url).Host Path = $wa.IisSettings[0].Path - Port = [Uri]::New($wa.Url).Port + Port = (New-Object System.Uri $wa.Url).Port AuthenticationMethod = $localAuthMode InstallAccount = $params.InstallAccount } From ee2e7661b9dc383159428591a988500524d38ae8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 00:37:33 +1000 Subject: [PATCH 47/69] Update harness to output results, integrated to AppVeyor --- Tests/xSharePoint.TestHarness.psm1 | 15 ++++++++++++++- appveyor.yml | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Tests/xSharePoint.TestHarness.psm1 b/Tests/xSharePoint.TestHarness.psm1 index 5dcbc4aa0..5fd8a6355 100644 --- a/Tests/xSharePoint.TestHarness.psm1 +++ b/Tests/xSharePoint.TestHarness.psm1 @@ -1,9 +1,20 @@ function Invoke-xSharePointTests() { + param + ( + [parameter(Mandatory = $false)] [System.String] $testResultsFile + ) + $repoDir = Join-Path $PSScriptRoot "..\" -Resolve $testCoverageFiles = @() Get-ChildItem "$repoDir\modules\xSharePoint\**\*.psm1" -Recurse | ForEach-Object { $testCoverageFiles += $_.FullName } + $testResultSettings = @{ } + if ([string]::IsNullOrEmpty($testResultsFile) -eq $false) { + $testResultSettings.Add("OutputFormat", "NUnitXml" ) + $testResultSettings.Add("OutputFile", $testResultsFile) + } + $results = Invoke-Pester -Script @( @{ 'Path' = $repoDir @@ -17,7 +28,9 @@ function Invoke-xSharePointTests() { 'SharePointCmdletModule' = (Join-Path $repoDir "\Tests\Stubs\SharePoint\16.0.4316.1217\Microsoft.SharePoint.PowerShell.psm1") } } - ) -CodeCoverage $testCoverageFiles -PassThru + ) -CodeCoverage $testCoverageFiles -PassThru @testResultSettings + + return $results } function Write-xSharePointStubFiles() { diff --git a/appveyor.yml b/appveyor.yml index d9a05c8f2..7ddccfb41 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,8 +13,8 @@ test_script: - ps: | $testResultsFile = ".\TestsResults.xml" $testCoverageFiles = @() - Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint\**\*.psm1" -Recurse | ForEach-Object { $testCoverageFiles += $_.FullName } - $res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru -CodeCoverage $testCoverageFiles + Import-Module "$env:APPVEYOR_BUILD_FOLDER\Tests\xSharePoint.TestHarness.psm1" + $res = Invoke-xSharePointTests $testResultsFile (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed." From 601cbe6db0910838d45f07b8f8198dced539c2cd Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 00:41:04 +1000 Subject: [PATCH 48/69] Imported module specifically during tests --- Tests/xSharePoint.TestHarness.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/xSharePoint.TestHarness.psm1 b/Tests/xSharePoint.TestHarness.psm1 index 5fd8a6355..7c4fdadd7 100644 --- a/Tests/xSharePoint.TestHarness.psm1 +++ b/Tests/xSharePoint.TestHarness.psm1 @@ -11,9 +11,10 @@ function Invoke-xSharePointTests() { $testResultSettings = @{ } if ([string]::IsNullOrEmpty($testResultsFile) -eq $false) { - $testResultSettings.Add("OutputFormat", "NUnitXml" ) + $testResultSettings.Add("OutputFormat", "NUnitXml" ) $testResultSettings.Add("OutputFile", $testResultsFile) } + Import-Module "$repoDir\modules\xSharePoint" $results = Invoke-Pester -Script @( @{ From b67e90a8e0082917882d6fd172cc3298c1c68663 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 00:56:14 +1000 Subject: [PATCH 49/69] Testing fix for appveyor build --- Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index f2eafb624..6ef2cf9bb 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -15,6 +15,7 @@ $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPBCSServiceApp" +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPBCSServiceApp" { From e75ce7816d56f6ac652c77db962f8fa53503ed4a Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 07:56:41 +1000 Subject: [PATCH 50/69] Removed DSC test clone --- appveyor.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7ddccfb41..1a3d54eb0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,11 +1,7 @@ version: 0.6.{build}.0 install: - - cinst -y pester - - git clone https://github.com/PowerShell/DscResource.Tests - - ps: | - Import-Module .\DscResource.Tests\TestHelper.psm1 -force - + - cinst -y pester build: off @@ -31,5 +27,5 @@ after_test: New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath . nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory $env:APPVEYOR_BUILD_FOLDER - $nuGetPackageName = $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg" + $nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg" Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\$nuGetPackageName" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } From 3169cd76eb05428178c5632fb4c181f8b6ee6629 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 07:58:08 +1000 Subject: [PATCH 51/69] Fixed tests directory --- Tests/xSharePoint.TestHarness.psm1 | 4 ++-- appveyor.yml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Tests/xSharePoint.TestHarness.psm1 b/Tests/xSharePoint.TestHarness.psm1 index 7c4fdadd7..a729aa5d8 100644 --- a/Tests/xSharePoint.TestHarness.psm1 +++ b/Tests/xSharePoint.TestHarness.psm1 @@ -18,13 +18,13 @@ function Invoke-xSharePointTests() { $results = Invoke-Pester -Script @( @{ - 'Path' = $repoDir + 'Path' = "$repoDir\Tests" 'Parameters' = @{ 'SharePointCmdletModule' = (Join-Path $repoDir "\Tests\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1") } }, @{ - 'Path' = $repoDir + 'Path' = "$repoDir\Tests" 'Parameters' = @{ 'SharePointCmdletModule' = (Join-Path $repoDir "\Tests\Stubs\SharePoint\16.0.4316.1217\Microsoft.SharePoint.PowerShell.psm1") } diff --git a/appveyor.yml b/appveyor.yml index 1a3d54eb0..d96aa691f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,11 @@ version: 0.6.{build}.0 install: - - cinst -y pester + - cinst -y pester + - git clone https://github.com/PowerShell/DscResource.Tests + - ps: | + Import-Module .\DscResource.Tests\TestHelper.psm1 -force + build: off From 65d277b790c43590ea302a24adc804134263090e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:01:37 +1000 Subject: [PATCH 52/69] Path fixes for AppVeyor --- Tests/xSharePoint.TestHarness.psm1 | 2 +- Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/xSharePoint.TestHarness.psm1 b/Tests/xSharePoint.TestHarness.psm1 index a729aa5d8..59f098825 100644 --- a/Tests/xSharePoint.TestHarness.psm1 +++ b/Tests/xSharePoint.TestHarness.psm1 @@ -14,7 +14,7 @@ function Invoke-xSharePointTests() { $testResultSettings.Add("OutputFormat", "NUnitXml" ) $testResultSettings.Add("OutputFile", $testResultsFile) } - Import-Module "$repoDir\modules\xSharePoint" + Import-Module "$repoDir\modules\xSharePoint\xSharePoint.psd1" $results = Invoke-Pester -Script @( @{ diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 6ef2cf9bb..6f5629e3e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -15,7 +15,7 @@ $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPBCSServiceApp" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\") +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPBCSServiceApp" { From 2c769ebce7accf60cfe342e46fefcf2a9d0116b8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:05:00 +1000 Subject: [PATCH 53/69] Added module reference --- Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 6f5629e3e..1f06d0fdc 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -15,7 +15,7 @@ $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPBCSServiceApp" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint") +Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\Modules\xSharePoint.Util\xSharePoint.Util.psm1") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPBCSServiceApp" { From 56aca97cb5663fbf1c3cdeb05689b1be646ac1f3 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:07:43 +1000 Subject: [PATCH 54/69] Testing new load technique --- Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 1f06d0fdc..076a04b06 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -15,7 +15,6 @@ $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path $Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPBCSServiceApp" -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\Modules\xSharePoint.Util\xSharePoint.Util.psm1") Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") Describe "xSPBCSServiceApp" { @@ -28,6 +27,8 @@ Describe "xSPBCSServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + Mock Initialize-xSharePointPSSnapin { } Context "When no service application exists in the current farm" { From 907f4e59284a92e7f42474fa90736d1973636060 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:14:15 +1000 Subject: [PATCH 55/69] Fixed module load approaches --- Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 | 1 + .../xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 | 1 + .../xSharePoint.xSPDistributedCacheService.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 | 1 + .../xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 | 1 + .../xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 | 1 + .../xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 | 1 + .../xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 | 1 + 22 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 076a04b06..1a8f20237 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -27,7 +27,7 @@ Describe "xSPBCSServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } diff --git a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 index dc162e3db..e8d3b1471 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 @@ -21,6 +21,7 @@ Describe "xSPCacheAccounts" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock Set-xSharePointCacheReaderPolicy {} Mock Set-xSharePointCacheOwnerPolicy {} diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index 38ef599b3..ec6cc1635 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -35,6 +35,7 @@ Describe "xSPCreateFarm" { $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = $majorBuildNumber } } diff --git a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 index e9cbebfe6..2c8517882 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 @@ -36,6 +36,7 @@ Describe "xSPDiagnosticLoggingSettings" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Context "Diagnostic configuration can not be loaded" { diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 8f7eedadb..010c27ffc 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -24,6 +24,7 @@ Describe "xSPDistributedCacheService" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path Import-Module "$RepoRoot\Tests\Stubs\DistributedCache\DistributedCache.psm1" -WarningAction SilentlyContinue diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index 3a0ea039a..91eecb543 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -27,6 +27,7 @@ Describe "xSPFeature" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock Enable-SPFeature {} Mock Disable-SPFeature {} diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index b224206fb..c57e51e37 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -18,6 +18,7 @@ Describe "xSPInstall" { ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Context "SharePoint binaries are not installed but should be" { Mock Get-CimInstance { return $null } diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index ccbf690e8..dcac7762a 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -21,6 +21,7 @@ Describe "xSPInstallPrereqs" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) diff --git a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 index b91bf63c3..f78c49e75 100644 --- a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 @@ -21,6 +21,7 @@ Describe "xSPJoinFarm" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock Connect-SPConfigurationDatabase {} Mock Install-SPHelpCollection {} diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 index 24a679b4a..7d2d41236 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 @@ -23,6 +23,7 @@ Describe "xSPManagedAccount" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPManagedAccount { } Mock Set-SPManagedAccount { } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 index 85dd3fd64..d51336231 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 @@ -22,6 +22,7 @@ Describe "xSPManagedMetaDataServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Context "When no service application exists in the current farm" { diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 index 38331a592..5fc319740 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 @@ -22,6 +22,7 @@ Describe "xSPManagedPath" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPManagedPath { } diff --git a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 index 6cfb0f037..30ef0b45c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 @@ -20,6 +20,7 @@ Describe "xSPSearchServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Context "When no service application exists in the current farm" { diff --git a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 index 8722f4bc6..eb3ee009e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 @@ -21,6 +21,7 @@ Describe "xSPSecureStoreServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 index ee02b76c6..306bd8c4a 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 @@ -20,6 +20,7 @@ Describe "xSPServiceAppPool" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPServiceApplicationPool { } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 index 31d6f079c..ed08fb904 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 @@ -20,6 +20,7 @@ Describe "xSPServiceInstance" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock Start-SPServiceInstance { } Mock Stop-SPServiceInstance { } diff --git a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 index 921d1c797..56cfcc4b3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 @@ -20,6 +20,7 @@ Describe "xSPSite" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPSite { } diff --git a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 index 8a2e60caa..d2fd9bdf7 100644 --- a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 @@ -20,6 +20,7 @@ Describe "xSPStateServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPStateServiceDatabase { return @{} } Mock New-SPStateServiceApplication { return @{} } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 index e666757cc..0ff6400a7 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 @@ -21,6 +21,7 @@ Describe "xSPUserProfileServiceApp" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock Get-UserProfileServiceProperties { return @{ ProfileDatabase = @{ diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index 5e42c1d43..21e296e2f 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -21,6 +21,7 @@ Describe "xSPUserProfileSyncService" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock Get-SPFarm { return @{ DefaultServiceAccount = @{ Name = $testParams.FarmAccount.Username } diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 index 9afd4a661..a9d7e6358 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 @@ -23,6 +23,7 @@ Describe "xSPWebApplication" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPAuthenticationProvider { } Mock New-SPWebApplication { } diff --git a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 index 4826fc22b..1c8731e8e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 @@ -23,6 +23,7 @@ Describe "xSPUsageApplication" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPUsageApplication { } Mock Set-SPUsageService { } From 2018ab83e11ec66ba68c74588a96c637d8d86bb6 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:19:47 +1000 Subject: [PATCH 56/69] Fixing missed module import --- Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index ec6cc1635..a2c1aa235 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -24,6 +24,7 @@ Describe "xSPCreateFarm" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPConfigurationDatabase {} Mock Install-SPHelpCollection {} From ef2fd8aa7adc2a07bffc9bfbde2c0695a12f72bd Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:21:37 +1000 Subject: [PATCH 57/69] Fixed spacing --- Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index a2c1aa235..b13ea4778 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -24,7 +24,7 @@ Describe "xSPCreateFarm" { } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } Mock New-SPConfigurationDatabase {} Mock Install-SPHelpCollection {} From 16958648c2f0cdd05f996b107610d303846defa8 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 08:25:04 +1000 Subject: [PATCH 58/69] Removed duplicate load --- Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index b13ea4778..344e2aea3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -36,8 +36,6 @@ Describe "xSPCreateFarm" { $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Get-xSharePointInstalledProductVersion { return @{ FileMajorPart = $majorBuildNumber } } Context "no farm is configured locally and a supported version of SharePoint is installed" { From 81bc151fc05002cf28106d2d1e4a034719509d08 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 19:39:13 +1000 Subject: [PATCH 59/69] Updated build to 0.7 --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d96aa691f..f37a60a92 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.6.{build}.0 +version: 0.7.{build}.0 install: - cinst -y pester @@ -24,7 +24,7 @@ after_test: - ps: | Remove-Item (Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.pssproj") $manifest = Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.psd1" - (Get-Content $manifest -Raw).Replace("0.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest + (Get-Content $manifest -Raw).Replace("0.7.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory("$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint", "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip") Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } From 3a6d819fffc31f85f1ecf13a98ea70e1e50fb44e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Thu, 24 Sep 2015 19:39:52 +1000 Subject: [PATCH 60/69] Updated to 0.7 --- Modules/xSharePoint/xSharePoint.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 800950a2a..f4cc7d1b5 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '0.6.0.0' +ModuleVersion = '0.7.0.0' # ID used to uniquely identify this module GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90' From c02d97394d1b5f7517d6c09edbc2bf3b1020249e Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 13:19:31 +1000 Subject: [PATCH 61/69] Fixed loading of PSSnapin --- .../MSFT_xSPBCSServiceApp.psm1 | 6 +-- .../MSFT_xSPCacheAccounts.psm1 | 4 +- .../MSFT_xSPCreateFarm.psm1 | 4 +- .../MSFT_xSPDiagnosticLoggingSettings.psm1 | 4 +- .../MSFT_xSPDistributedCacheService.psm1 | 6 +-- .../MSFT_xSPFeature/MSFT_xSPFeature.psm1 | 4 +- .../MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 | 4 +- .../MSFT_xSPManagedAccount.psm1 | 4 +- .../MSFT_xSPManagedMetaDataServiceApp.psm1 | 6 +-- .../MSFT_xSPManagedPath.psm1 | 4 +- .../MSFT_xSPSearchServiceApp.psm1 | 6 +-- .../MSFT_xSPSecureStoreServiceApp.psm1 | 6 +-- .../MSFT_xSPServiceAppPool.psm1 | 4 +- .../MSFT_xSPServiceInstance.psm1 | 6 +-- .../MSFT_xSPSite/MSFT_xSPSite.psm1 | 4 +- .../MSFT_xSPStateServiceApp.psm1 | 4 +- .../MSFT_xSPUsageApplication.psm1 | 6 +-- .../MSFT_xSPUserProfileServiceApp.psm1 | 4 +- .../MSFT_xSPUserProfileSyncService.psm1 | 4 +- .../MSFT_xSPWebApplication.psm1 | 4 +- .../xSharePoint.DistributedCache.psm1 | 2 +- .../xSharePoint.Util/xSharePoint.Util.psm1 | 54 +++++-------------- Modules/xSharePoint/xSharePoint.psd1 | 7 ++- appveyor.yml | 4 +- 24 files changed, 67 insertions(+), 94 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 index 00a4c102e..9163e831a 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 @@ -14,7 +14,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { @@ -57,7 +57,7 @@ function Set-TargetResource Write-Verbose -Message "Creating BCS Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + New-SPBusinessDataCatalogServiceApplication -Name $params.Name ` -ApplicationPool $params.ApplicationPool ` @@ -70,7 +70,7 @@ function Set-TargetResource Write-Verbose -Message "Updating BCS Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 index 098b24ed4..1034c3baf 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCacheAccounts/MSFT_xSPCacheAccounts.psm1 @@ -14,7 +14,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue @@ -54,7 +54,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue if ($null -eq $wa) { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index c039da403..30aa00b47 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -17,7 +17,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + Add-PSSnapin -Name "Microsoft.SharePoint.PowerShell" try { $spFarm = Get-SPFarm @@ -68,7 +68,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + Add-PSSnapin -Name "Microsoft.SharePoint.PowerShell" $newFarmArgs = @{ DatabaseServer = $params.DatabaseServer diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 index c18d2e1ef..a9eac3b62 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDiagnosticLoggingSettings/MSFT_xSPDiagnosticLoggingSettings.psm1 @@ -29,7 +29,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $dc = Get-SPDiagnosticConfig -ErrorAction SilentlyContinue if ($null -eq $dc) { return $null } @@ -90,7 +90,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } $params = $params | Rename-xSharePointParamValue -oldName "LogPath" -newName "LogLocation" ` diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index 2eafd31f2..195f0ab1b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource } try { - Initialize-xSharePointPSSnapin + Use-CacheCluster -ErrorAction SilentlyContinue $cacheHost = Get-CacheHost -ErrorAction SilentlyContinue @@ -84,14 +84,14 @@ function Set-TargetResource Write-Verbose -Message "Enabling distributed cache service" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + Add-xSharePointDistributedCacheServer -CacheSizeInMB $params.CacheSizeInMB -ServiceAccount $params.ServiceAccount } } } else { Write-Verbose -Message "Removing distributed cache to the server" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { - Initialize-xSharePointPSSnapin + Remove-xSharePointDistributedCacheServer } if ($CreateFirewallRules -eq $true) { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 index 872610d40..ea16a0fb2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPFeature/MSFT_xSPFeature.psm1 @@ -15,7 +15,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $feature = Get-SPFeature -Identity $params.Name -ErrorAction SilentlyContinue @@ -64,7 +64,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $runParams = @{} $runParams.Add("Identity", $params.Name) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 index 693b31a9e..53418eb70 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPJoinFarm/MSFT_xSPJoinFarm.psm1 @@ -14,7 +14,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + try { $spFarm = Get-SPFarm -ErrorAction SilentlyContinue @@ -52,7 +52,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $joinFarmArgs = @{ DatabaseServer = $params.DatabaseServer diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 index 89158a88c..015e3fc95 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedAccount/MSFT_xSPManagedAccount.psm1 @@ -16,7 +16,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + try { $ma = Get-SPManagedAccount -Identity $params.Account.UserName -ErrorAction SilentlyContinue @@ -53,7 +53,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $current = Get-TargetResource @params if ($current.Count -eq 0) { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 index 52d25f9b2..79b301f55 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 @@ -15,7 +15,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + try { @@ -67,7 +67,7 @@ function Set-TargetResource Write-Verbose -Message "Creating Managed Metadata Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } @@ -88,7 +88,7 @@ function Set-TargetResource Write-Verbose -Message "Updating Managed Metadata Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Managed Metadata Service" } $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 index f9f51a59e..30da5d478 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedPath/MSFT_xSPManagedPath.psm1 @@ -15,7 +15,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $getParams = @{ Identity = $params.RelativeUrl @@ -56,7 +56,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $path = Get-TargetResource @params -ErrorAction SilentlyContinue diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 index 43af1b72c..ff62feb88 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 @@ -15,7 +15,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { @@ -57,7 +57,7 @@ function Set-TargetResource Write-Verbose -Message "Creating Search Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } @@ -73,7 +73,7 @@ function Set-TargetResource Write-Verbose -Message "Updating Search Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Search Service Application" } $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 index 26e402f6b..3fad07354 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSecureStoreServiceApp/MSFT_xSPSecureStoreServiceApp.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { @@ -74,7 +74,7 @@ function Set-TargetResource Write-Verbose -Message "Creating Secure Store Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } @@ -98,7 +98,7 @@ function Set-TargetResource Write-Verbose -Message "Updating Secure Store Service Application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApp = Get-SPServiceApplication -Name $params.Name | Where-Object { $_.TypeName -eq "Secure Store Service Application" } $appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 index cf028547e..7ebe121e8 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceAppPool/MSFT_xSPServiceAppPool.psm1 @@ -13,7 +13,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $sap = Get-SPServiceApplicationPool -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $sap) { return $null } @@ -42,7 +42,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $sap = Get-SPServiceApplicationPool -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $sap) { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 index 024b0b74b..2fefb2ef4 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPServiceInstance/MSFT_xSPServiceInstance.psm1 @@ -13,7 +13,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $si = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq $params.Name } if ($null -eq $si) { return @{ @@ -48,7 +48,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $si = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq $params.Name } if ($null -eq $si) { @@ -61,7 +61,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $si = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq $params.Name } if ($null -eq $si) { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 index c4ccb2ae8..fe9206883 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPSite/MSFT_xSPSite.psm1 @@ -24,7 +24,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $site = Get-SPSite -Identity $params.Url -ErrorAction SilentlyContinue @@ -100,7 +100,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $params.Remove("InstallAccount") | Out-Null diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 index b33990c45..1637f5c3c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPStateServiceApp/MSFT_xSPStateServiceApp.psm1 @@ -15,7 +15,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApp = Get-SPStateServiceApplication -Identity $params.Name -ErrorAction SilentlyContinue @@ -48,7 +48,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $app = Get-SPStateServiceApplication -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $app) { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 index e9ea867a5..088d93e97 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUsageApplication/MSFT_xSPUsageApplication.psm1 @@ -21,7 +21,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { @@ -80,7 +80,7 @@ function Set-TargetResource if ($null -eq $CurrentState) { Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $newParams = @{} $newParams.Add("Name", $params.Name) @@ -97,7 +97,7 @@ function Set-TargetResource Write-Verbose -Message "Configuring usage application $Name" Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $setParams = @{} $setParams.Add("LoggingEnabled", $true) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 index 296834a8c..4e5698f54 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileServiceApp/MSFT_xSPUserProfileServiceApp.psm1 @@ -21,7 +21,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { @@ -114,7 +114,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $FarmAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + if ($params.ContainsKey("InstallAccount")) { $params.Remove("InstallAccount") | Out-Null } $params.Remove("FarmAccount") | Out-Null diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index 00ecf09a5..493bd1971 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -13,7 +13,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $syncService = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq "User Profile Synchronization Service" } @@ -74,7 +74,7 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $FarmAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $syncService = Get-SPServiceInstance -Server $env:COMPUTERNAME | Where-Object { $_.TypeName -eq "User Profile Synchronization Service" } diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 index a4e29c115..1b519c8a6 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPWebApplication/MSFT_xSPWebApplication.psm1 @@ -22,7 +22,7 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $wa) { return $null } @@ -73,7 +73,7 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Initialize-xSharePointPSSnapin + $wa = Get-SPWebApplication -Identity $params.Name -ErrorAction SilentlyContinue if ($null -eq $wa) { diff --git a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 index c77b28fee..10aec41db 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 @@ -10,7 +10,7 @@ function Add-xSharePointDistributedCacheServer() { [System.String] $ServiceAccount ) - Initialize-xSharePointPSSnapin + Add-SPDistributedCacheServiceInstance Update-SPDistributedCacheSize -CacheSizeInMB $CacheSizeInMB diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 8be3d0114..6254965a0 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -18,7 +18,7 @@ function Invoke-xSharePointCommand() { $VerbosePreference = 'Continue' $invokeArgs = @{ - ScriptBlock = $ScriptBlock + ScriptBlock = [ScriptBlock]::Create("Initialize-xSharePointPSSnapin; " + $ScriptBlock.ToString()) } if ($null -ne $Arguments) { $invokeArgs.Add("ArgumentList", $Arguments) @@ -31,7 +31,7 @@ function Invoke-xSharePointCommand() { } Write-Verbose "Executing as the local run as user $($Env:USERDOMAIN)\$($Env:USERNAME)" - $result = Invoke-Command @invokeArgs -Verbose + $result = Invoke-Command @invokeArgs -Verbose -NoNewScope return $result } else { if ($Credential.UserName.Split("\")[1] -eq $Env:USERNAME) { @@ -56,45 +56,19 @@ function Invoke-xSharePointCommand() { } } -function Invoke-xSharePointSPCmdlet() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [string] - $CmdletName, - - [parameter(Mandatory = $false,Position=2)] - [HashTable] - $Arguments - ) - - Write-Verbose "Preparing to execute SharePoint command - $CmdletName" - - if ($null -ne $Arguments -and $Arguments.Count -gt 0) { - $argumentsString = "" - $Arguments.Keys | ForEach-Object { - $argumentsString += "$($_): $($Arguments.$_); " - } - Write-Verbose "Arguments for $CmdletName - $argumentsString" - } - - if ($null -eq $Arguments) { - $script = ([scriptblock]::Create("Initialize-xSharePointPSSnapin; $CmdletName; `$params = `$null")) - $result = Invoke-Command -ScriptBlock $script -NoNewScope - } else { - $script = ([scriptblock]::Create("Initialize-xSharePointPSSnapin; `$params = `$args[0]; $CmdletName @params; `$params = `$null")) - $result = Invoke-Command -ScriptBlock $script -ArgumentList $Arguments -NoNewScope - } - return $result -} - function Initialize-xSharePointPSSnapin() { - if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) - { - Write-Verbose "Loading SharePoint PowerShell snapin" - Add-PSSnapin -Name "Microsoft.SharePoint.PowerShell" - } + Write-Verbose "Checking for the powershell snapin" + if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) + { + Write-Verbose "Loading SharePoint PowerShell snapin" + try + { + Add-PSSnapin "Microsoft.SharePoint.PowerShell" + } catch { + Write-Verbose ( $_ | Format-List | Out-String ) + } + + } } function Rename-xSharePointParamValue() { diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 800950a2a..81a314ddd 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -12,7 +12,7 @@ # RootModule = '' # Version number of this module. -ModuleVersion = '0.6.0.0' +ModuleVersion = '0.7.0.0' # ID used to uniquely identify this module GUID = '6c1176a0-4fac-4134-8ca2-3fa8a21a7b90' @@ -75,9 +75,7 @@ FunctionsToExport = '*' CmdletsToExport = @("Add-xSharePointDistributedCacheServer", "Remove-xSharePointDistributedCacheServer", "Invoke-xSharePointCommand", - "Initialize-xSharePointPSSnapin", "Get-xSharePointInstalledProductVersion", - "Invoke-xSharePointSPCmdlet", "Rename-xSharePointParamValue", "Update-xSharePointObject", "Set-xSharePointCacheReaderPolicy", @@ -89,7 +87,8 @@ CmdletsToExport = @("Add-xSharePointDistributedCacheServer", "Remove-xSharePointUserToLocalAdmin", "Test-xSharePointUserIsLocalAdmin", "Set-xSharePointUserProfileSyncMachine", - "Test-xSharePointSpecificParameters") + "Test-xSharePointSpecificParameters", + "Initialize-xSharePointPSSnapin") # Variables to export from this module VariablesToExport = '*' diff --git a/appveyor.yml b/appveyor.yml index d96aa691f..f37a60a92 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.6.{build}.0 +version: 0.7.{build}.0 install: - cinst -y pester @@ -24,7 +24,7 @@ after_test: - ps: | Remove-Item (Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.pssproj") $manifest = Join-Path "$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint" "xSharePoint.psd1" - (Get-Content $manifest -Raw).Replace("0.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest + (Get-Content $manifest -Raw).Replace("0.7.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory("$env:APPVEYOR_BUILD_FOLDER\modules\xSharePoint", "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip") Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\xSharePoint.zip" | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } From a8aef31d23f6bab7b0fd620b2c1db9c5e9dc0c01 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 13:20:26 +1000 Subject: [PATCH 62/69] Fixed spacing in file --- .../xSharePoint.Util/xSharePoint.Util.psm1 | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 6254965a0..10daa4284 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -57,18 +57,18 @@ function Invoke-xSharePointCommand() { } function Initialize-xSharePointPSSnapin() { - Write-Verbose "Checking for the powershell snapin" - if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) - { - Write-Verbose "Loading SharePoint PowerShell snapin" - try - { - Add-PSSnapin "Microsoft.SharePoint.PowerShell" - } catch { - Write-Verbose ( $_ | Format-List | Out-String ) - } - - } + Write-Verbose "Checking for the powershell snapin" + if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) + { + Write-Verbose "Loading SharePoint PowerShell snapin" + try + { + Add-PSSnapin "Microsoft.SharePoint.PowerShell" + } catch { + Write-Verbose ( $_ | Format-List | Out-String ) + } + + } } function Rename-xSharePointParamValue() { From eb49fd2e960b0f30aa424989b7705c198c68a470 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 15:30:26 +1000 Subject: [PATCH 63/69] Updated module loads and minor mocks in tests --- .../MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 | 1 - .../MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 | 2 -- .../MSFT_xSPDistributedCacheService.psm1 | 2 -- .../MSFT_xSPManagedMetaDataServiceApp.psm1 | 8 ++++---- .../xSharePoint.DistributedCache.psm1 | 2 +- .../Modules/xSharePoint.Util/xSharePoint.Util.psm1 | 2 +- .../xSharePoint.xSPBCSServiceApp.Tests.ps1 | 10 ++++++---- .../xSharePoint.xSPCacheAccounts.Tests.ps1 | 9 ++++++--- .../xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 | 9 ++++++--- ...SharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPDistributedCacheService.Tests.ps1 | 12 +++++++----- Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 | 9 ++++++--- Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 | 7 ++++++- .../xSharePoint.xSPInstallPrereqs.Tests.ps1 | 8 ++++++-- Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPManagedAccount.Tests.ps1 | 9 ++++++--- ...SharePoint.xSPManagedMetadataServiceApp.Tests.ps1 | 12 ++++++++---- .../xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPSearchServiceApp.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 | 10 ++++++---- .../xSharePoint.xSPServiceAppPool.Tests.ps1 | 10 ++++++---- .../xSharePoint.xSPServiceInstance.Tests.ps1 | 9 ++++++--- Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPStateServiceApp.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPUserProfileServiceApp.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPUserProfileSyncService.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPWebApplication.Tests.ps1 | 9 ++++++--- .../xSharePoint.xSPusageApplication.Tests.ps1 | 9 ++++++--- 28 files changed, 141 insertions(+), 80 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 index 9163e831a..bbd3967e7 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPBCSServiceApp/MSFT_xSPBCSServiceApp.psm1 @@ -15,7 +15,6 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { return $null diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 index 30aa00b47..61983d91b 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPCreateFarm/MSFT_xSPCreateFarm.psm1 @@ -17,7 +17,6 @@ function Get-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Add-PSSnapin -Name "Microsoft.SharePoint.PowerShell" try { $spFarm = Get-SPFarm @@ -68,7 +67,6 @@ function Set-TargetResource $result = Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Add-PSSnapin -Name "Microsoft.SharePoint.PowerShell" $newFarmArgs = @{ DatabaseServer = $params.DatabaseServer diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index 195f0ab1b..0c88f5104 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -23,8 +23,6 @@ function Get-TargetResource } try { - - Use-CacheCluster -ErrorAction SilentlyContinue $cacheHost = Get-CacheHost -ErrorAction SilentlyContinue diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 index 79b301f55..32e85b85c 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPManagedMetadataServiceApp/MSFT_xSPManagedMetaDataServiceApp.psm1 @@ -76,10 +76,10 @@ function Set-TargetResource { New-SPMetadataServiceApplicationProxy -Name ($params.Name + " Proxy") ` -ServiceApplication $app ` - -DefaultProxyGroup $true ` - -ContentTypePushdownEnabled $true ` - -DefaultKeywordTaxonomy = $true ` - -DefaultSiteCollectionTaxonomy = $true + -DefaultProxyGroup ` + -ContentTypePushdownEnabled ` + -DefaultKeywordTaxonomy ` + -DefaultSiteCollectionTaxonomy } } } diff --git a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 index 10aec41db..a41f95e12 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 @@ -10,7 +10,7 @@ function Add-xSharePointDistributedCacheServer() { [System.String] $ServiceAccount ) - + Initialize-xSharePointPSSnapin Add-SPDistributedCacheServiceInstance Update-SPDistributedCacheSize -CacheSizeInMB $CacheSizeInMB diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 10daa4284..6571791fe 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -31,7 +31,7 @@ function Invoke-xSharePointCommand() { } Write-Verbose "Executing as the local run as user $($Env:USERDOMAIN)\$($Env:USERNAME)" - $result = Invoke-Command @invokeArgs -Verbose -NoNewScope + $result = Invoke-Command @invokeArgs -Verbose return $result } else { if ($Credential.UserName.Split("\")[1] -eq $Env:USERNAME) { diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 1a8f20237..190ac91ad 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -26,10 +26,12 @@ Describe "xSPBCSServiceApp" { DatabaseServer = "TestServer\Instance" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Context "When no service application exists in the current farm" { diff --git a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 index e8d3b1471..288d6178d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 @@ -20,9 +20,12 @@ Describe "xSPCacheAccounts" { SuperReaderAlias = "DEMO\SuperReader" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock Set-xSharePointCacheReaderPolicy {} Mock Set-xSharePointCacheOwnerPolicy {} Mock Update-xSharePointObject {} diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index 344e2aea3..b071a2e6e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -23,9 +23,12 @@ Describe "xSPCreateFarm" { CentralAdministrationPort = 1234 } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPConfigurationDatabase {} Mock Install-SPHelpCollection {} Mock Initialize-SPResourceSecurity {} diff --git a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 index 2c8517882..6b5d33b6d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 @@ -35,9 +35,12 @@ Describe "xSPDiagnosticLoggingSettings" { EventLogFloodProtectionNotifyInterval = 5 } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Context "Diagnostic configuration can not be loaded" { Mock Get-SPDiagnosticConfig { return $null } diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 010c27ffc..366874a8e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -23,13 +23,15 @@ Describe "xSPDistributedCacheService" { CreateFirewallRules = $true } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.DistributedCache" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue $RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path Import-Module "$RepoRoot\Tests\Stubs\DistributedCache\DistributedCache.psm1" -WarningAction SilentlyContinue - - Mock Initialize-xSharePointPSSnapin { } - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.DistributedCache" Mock Use-CacheCluster { } Mock Get-WmiObject { return @{ StartName = $testParams.ServiceAccount } } Mock Get-NetFirewallRule { return @{} } diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index 91eecb543..6c7bb2a57 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -26,9 +26,12 @@ Describe "xSPFeature" { Ensure = "Present" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock Enable-SPFeature {} Mock Disable-SPFeature {} diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index c57e51e37..530d0fa29 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -18,7 +18,12 @@ Describe "xSPInstall" { ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Context "SharePoint binaries are not installed but should be" { Mock Get-CimInstance { return $null } diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index dcac7762a..fa7505b6c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -20,8 +20,12 @@ Describe "xSPInstallPrereqs" { Ensure = "Present" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) diff --git a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 index f78c49e75..655af33d9 100644 --- a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 @@ -20,9 +20,12 @@ Describe "xSPJoinFarm" { Passphrase = "passphrase" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock Connect-SPConfigurationDatabase {} Mock Install-SPHelpCollection {} Mock Initialize-SPResourceSecurity {} diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 index 7d2d41236..23377903b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 @@ -22,9 +22,12 @@ Describe "xSPManagedAccount" { AccountName = "username" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPManagedAccount { } Mock Set-SPManagedAccount { } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 index d51336231..fd7ef366a 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 @@ -21,14 +21,18 @@ Describe "xSPManagedMetaDataServiceApp" { DatabaseName = "SP_MMS" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Context "When no service application exists in the current farm" { Mock Get-SPServiceApplication { return $null } - Mock New-SPMetadataServiceApplication { } + Mock New-SPMetadataServiceApplication { return @{} } + Mock New-SPMetadataServiceApplicationProxy { return @{} } It "returns null from the Get method" { Get-TargetResource @testParams | Should BeNullOrEmpty diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 index 5fc319740..abaaa2b29 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 @@ -21,9 +21,12 @@ Describe "xSPManagedPath" { HostHeader = $false } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPManagedPath { } Context "The managed path does not exist and should" { diff --git a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 index 30ef0b45c..91508ca93 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 @@ -19,9 +19,12 @@ Describe "xSPSearchServiceApp" { ApplicationPool = "SharePoint Search Services" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Context "When no service application exists in the current farm" { diff --git a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 index eb3ee009e..e21b14c22 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 @@ -20,10 +20,12 @@ Describe "xSPSecureStoreServiceApp" { AuditingEnabled = $false } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } - + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue $versionBeingTested = (Get-Item $Global:CurrentSharePointStubModule).Directory.BaseName $majorBuildNumber = $versionBeingTested.Substring(0, $versionBeingTested.IndexOf(".")) diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 index 306bd8c4a..f33956f1b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 @@ -19,10 +19,12 @@ Describe "xSPServiceAppPool" { ServiceAccount = "DEMO\svcSPServiceApps" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } - + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPServiceApplicationPool { } Mock Set-SPServiceApplicationPool { } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 index ed08fb904..5edd6b47e 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 @@ -19,9 +19,12 @@ Describe "xSPServiceInstance" { Ensure = "Present" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock Start-SPServiceInstance { } Mock Stop-SPServiceInstance { } diff --git a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 index 56cfcc4b3..304f27850 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 @@ -19,9 +19,12 @@ Describe "xSPSite" { OwnerAlias = "DEMO\User" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPSite { } Context "The site doesn't exist yet and should" { diff --git a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 index d2fd9bdf7..f774117ab 100644 --- a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 @@ -19,9 +19,12 @@ Describe "xSPStateServiceApp" { DatabaseName = "SP_StateService" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPStateServiceDatabase { return @{} } Mock New-SPStateServiceApplication { return @{} } Mock New-SPStateServiceApplicationProxy { return @{} } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 index 0ff6400a7..74d1c88ac 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 @@ -20,9 +20,12 @@ Describe "xSPUserProfileServiceApp" { FarmAccount = New-Object System.Management.Automation.PSCredential ("domain\username", (ConvertTo-SecureString "password" -AsPlainText -Force)) } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock Get-UserProfileServiceProperties { return @{ ProfileDatabase = @{ Name = "SP_ProfileDB" diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index 21e296e2f..76c1eb225 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -20,9 +20,12 @@ Describe "xSPUserProfileSyncService" { Ensure = "Present" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock Get-SPFarm { return @{ DefaultServiceAccount = @{ Name = $testParams.FarmAccount.Username } }} diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 index a9d7e6358..7e1867263 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 @@ -22,9 +22,12 @@ Describe "xSPWebApplication" { AuthenticationMethod = "NTLM" } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPAuthenticationProvider { } Mock New-SPWebApplication { } diff --git a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 index 1c8731e8e..de4241420 100644 --- a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 @@ -22,9 +22,12 @@ Describe "xSPUsageApplication" { UsageLogMaxSpaceGB = 10 } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue - Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } + Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { + return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope + } + + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Mock New-SPUsageApplication { } Mock Set-SPUsageService { } Mock Get-SPUsageService { return @{ From 82bc4a71e35f1f7b21c987dea08737d7cd8451bc Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 16:46:51 +1000 Subject: [PATCH 64/69] Updated module loading in tests --- .../xSharePoint.DistributedCache.psm1 | 1 + .../xSharePoint.UserProfileService.psm1 | 1 + Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 | 3 ++- Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 | 2 +- .../xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 | 2 +- .../xSharePoint.xSPDistributedCacheService.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 | 1 + Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 | 2 +- .../xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 | 2 +- .../xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 | 2 +- Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 | 3 ++- Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 | 3 ++- .../xSharePoint.xSPUserProfileServiceApp.Tests.ps1 | 3 ++- .../xSharePoint.xSPUserProfileSyncService.Tests.ps1 | 3 ++- Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 | 5 +++-- Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 | 3 ++- 24 files changed, 32 insertions(+), 22 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 index a41f95e12..4937688e7 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 @@ -41,6 +41,7 @@ function Remove-xSharePointDistributedCacheServer() { $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername } $serviceInstance.Delete() + Initialize-xSharePointPSSnapin Remove-SPDistributedCacheServiceInstance } diff --git a/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 b/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 index d052d5188..dab52d34c 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 @@ -63,6 +63,7 @@ function Set-xSharePointUserProfileSyncMachine() { [PSCredential] $FarmAccount ) + Initialize-xSharePointPSSnapin $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue if ($null -eq $serviceApps) { return $null diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 190ac91ad..8e8095911 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -25,13 +25,14 @@ Describe "xSPBCSServiceApp" { DatabaseName = "Test_DB" DatabaseServer = "TestServer\Instance" } + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue Context "When no service application exists in the current farm" { diff --git a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 index 288d6178d..ec2148082 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPCacheAccounts" { SuperUserAlias = "DEMO\SuperUser" SuperReaderAlias = "DEMO\SuperReader" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index b071a2e6e..bd9680bdd 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -22,7 +22,7 @@ Describe "xSPCreateFarm" { AdminContentDatabaseName = "Admin_Content" CentralAdministrationPort = 1234 } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 index 6b5d33b6d..326fbd9fa 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 @@ -34,7 +34,7 @@ Describe "xSPDiagnosticLoggingSettings" { EventLogFloodProtectionQuietPeriod = 5 EventLogFloodProtectionNotifyInterval = 5 } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 366874a8e..d64f7f8e9 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -22,7 +22,7 @@ Describe "xSPDistributedCacheService" { ServiceAccount = "DOMAIN\user" CreateFirewallRules = $true } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.DistributedCache" Mock Invoke-xSharePointCommand { diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index 6c7bb2a57..f84656125 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -25,7 +25,7 @@ Describe "xSPFeature" { Url = "http://site.sharepoint.com" Ensure = "Present" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index 530d0fa29..878e0895f 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -18,6 +18,7 @@ Describe "xSPInstall" { ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" Ensure = "Present" } + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index fa7505b6c..76a17180d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPInstallPrereqs" { OnlineMode = $true Ensure = "Present" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 index 655af33d9..66b36f5bf 100644 --- a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPJoinFarm" { DatabaseServer = "DatabaseServer\Instance" Passphrase = "passphrase" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 index 23377903b..c1eb27e32 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 @@ -21,7 +21,7 @@ Describe "xSPManagedAccount" { Schedule = "" AccountName = "username" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 index fd7ef366a..eeef78fdd 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPManagedMetaDataServiceApp" { DatabaseServer = "databaseserver\instance" DatabaseName = "SP_MMS" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 index abaaa2b29..aa08e2dce 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPManagedPath" { Explicit = $false HostHeader = $false } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 index 91508ca93..867714ea0 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 @@ -18,7 +18,7 @@ Describe "xSPSearchServiceApp" { Name = "Search Service Application" ApplicationPool = "SharePoint Search Services" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 index e21b14c22..dbc9ea890 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPSecureStoreServiceApp" { ApplicationPool = "SharePoint Search Services" AuditingEnabled = $false } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 index f33956f1b..b04d57344 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 @@ -18,7 +18,7 @@ Describe "xSPServiceAppPool" { Name = "Service pool" ServiceAccount = "DEMO\svcSPServiceApps" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 index 5edd6b47e..466389c87 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 @@ -18,7 +18,7 @@ Describe "xSPServiceInstance" { Name = "Service pool" Ensure = "Present" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope diff --git a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 index 304f27850..5ef04b2b6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 @@ -18,13 +18,14 @@ Describe "xSPSite" { Url = "http://site.sharepoint.com" OwnerAlias = "DEMO\User" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock New-SPSite { } Context "The site doesn't exist yet and should" { diff --git a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 index f774117ab..d0d11e9d6 100644 --- a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 @@ -18,13 +18,14 @@ Describe "xSPStateServiceApp" { Name = "State Service App" DatabaseName = "SP_StateService" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock New-SPStateServiceDatabase { return @{} } Mock New-SPStateServiceApplication { return @{} } Mock New-SPStateServiceApplicationProxy { return @{} } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 index 74d1c88ac..21d2563db 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 @@ -19,13 +19,14 @@ Describe "xSPUserProfileServiceApp" { ApplicationPool = "SharePoint Service Applications" FarmAccount = New-Object System.Management.Automation.PSCredential ("domain\username", (ConvertTo-SecureString "password" -AsPlainText -Force)) } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Get-UserProfileServiceProperties { return @{ ProfileDatabase = @{ Name = "SP_ProfileDB" diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index 76c1eb225..0d97e077c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -19,13 +19,14 @@ Describe "xSPUserProfileSyncService" { FarmAccount = New-Object System.Management.Automation.PSCredential ("username", (ConvertTo-SecureString "password" -AsPlainText -Force)) Ensure = "Present" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock Get-SPFarm { return @{ DefaultServiceAccount = @{ Name = $testParams.FarmAccount.Username } }} diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 index 7e1867263..d235969c4 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 @@ -21,13 +21,14 @@ Describe "xSPWebApplication" { Url = "http://sites.sharepoint.com" AuthenticationMethod = "NTLM" } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } - Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock New-SPAuthenticationProvider { } Mock New-SPWebApplication { } diff --git a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 index de4241420..32146ecd3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 @@ -21,13 +21,14 @@ Describe "xSPUsageApplication" { UsageLogMaxFileSizeKB = 1024 UsageLogMaxSpaceGB = 10 } - + Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } Import-Module $Global:CurrentSharePointStubModule -WarningAction SilentlyContinue + Mock New-SPUsageApplication { } Mock Set-SPUsageService { } Mock Get-SPUsageService { return @{ From a57dd9c88af263a5d971c5ade8e6bdf5a39d5f64 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 18:57:22 +1000 Subject: [PATCH 65/69] Consolidated DCache and UPS functions to resources --- .../MSFT_xSPDistributedCacheService.psm1 | 50 +++++++++++-- .../MSFT_xSPUserProfileSyncService.psm1 | 27 ++++++- .../xSharePoint.DistributedCache.psm1 | 72 ------------------- .../xSharePoint.UserProfileService.psm1 | 25 ------- Modules/xSharePoint/xSharePoint.psd1 | 11 +-- Modules/xSharePoint/xSharePoint.pssproj | 2 - 6 files changed, 72 insertions(+), 115 deletions(-) delete mode 100644 Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index 0c88f5104..7837a34d2 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -72,8 +72,17 @@ function Set-TargetResource if($createFirewallRules -eq $true) { Write-Verbose -Message "Create a firewall rule for AppFabric" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { - Enable-xSharePointDCIcmpFireWallRule - Enable-xSharePointDCFireWallRule + $icmpFirewallRule = Get-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -ErrorAction SilentlyContinue + if($null -eq $icmpFirewallRule ) { + New-NetFirewallRule -Name Allow_Ping -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -Description "Allow ICMPv4 ping" -Protocol ICMPv4 -IcmpType 8 -Enabled True -Profile Any -Action Allow + } + Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" + + $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -ErrorAction SilentlyContinue + if($null -eq $firewallRule) { + New-NetFirewallRule -Name "SPDistCache" -DisplayName "SharePoint Distributed Cache" -Protocol TCP -LocalPort 22233-22236 -Group "SharePoint" + } + Enable-NetFirewallRule -DisplayName "SharePoint Distributed Cache" } Write-Verbose -Message "Firewall rule added" } @@ -83,24 +92,53 @@ function Set-TargetResource Invoke-xSharePointCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock { $params = $args[0] - Add-xSharePointDistributedCacheServer -CacheSizeInMB $params.CacheSizeInMB -ServiceAccount $params.ServiceAccount + Add-SPDistributedCacheServiceInstance + Update-SPDistributedCacheSize -CacheSizeInMB $params.CacheSizeInMB + + $farm = Get-SPFarm + $cacheService = $farm.Services | Where-Object { $_.Name -eq "AppFabricCachingService" } + $cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser" + + $account = Get-SPManagedAccount -Identity $params.ServiceAccount + $cacheService.ProcessIdentity.ManagedAccount = $account + + Update-DCacheService $cacheService } } } else { Write-Verbose -Message "Removing distributed cache to the server" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { - - Remove-xSharePointDistributedCacheServer + $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" + $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername } + $serviceInstance.Delete() + Initialize-xSharePointPSSnapin + Remove-SPDistributedCacheServiceInstance } if ($CreateFirewallRules -eq $true) { Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { - Disable-xSharePointDCFireWallRule + $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distribute Cache" -ErrorAction SilentlyContinue + if($null -ne $firewallRule) { + Write-Verbose -Message "Disabling firewall rules." + Disable-NetFirewallRule -DisplayName "SharePoint Distribute Cache" + } } } Write-Verbose -Message "Distributed cache removed." } } +function Update-DCacheService() { + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true,Position=1)] + [object] + $CacheService + ) + $CacheService.ProcessIdentity.Update() + $CacheService.ProcessIdentity.Deploy() +} + function Test-TargetResource { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index 493bd1971..e239267c9 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -80,7 +80,13 @@ function Set-TargetResource # Start the Sync service if it should be running on this server if (($params.Ensure -eq "Present") -and ($syncService.Status -ne "Online")) { - Set-xSharePointUserProfileSyncMachine -UserProfileServiceAppName $params.UserProfileServiceAppName -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount + $serviceApps = Get-SPServiceApplication -Name $params.UserProfileServiceAppName -ErrorAction SilentlyContinue + if ($null -eq $serviceApps) { + throw [Exception] "No user profile service was found named $($params.UserProfileServiceAppName)" + } + $ups = $serviceApps | Where-Object { $_.TypeName -eq "User Profile Service Application" } + + Set-UserProfileSyncMachine -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount Start-SPServiceInstance -Identity $syncService.ID $desiredState = "Online" @@ -111,6 +117,25 @@ function Set-TargetResource } } +function Set-UserProfileSyncMachine() { + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true,Position=2)] + [Guid] + $SyncServiceId, + + [parameter(Mandatory = $true,Position=3)] + [PSCredential] + $FarmAccount, + + [parameter(Mandatory = $true,Position=4)] + [object] + $Ups + ) + + $Ups.SetSynchronizationMachine($env:COMPUTERNAME, $SyncServiceId, $FarmAccount.UserName, $FarmAccount.GetNetworkCredential().Password) +} function Test-TargetResource { diff --git a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 b/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 deleted file mode 100644 index 4937688e7..000000000 --- a/Modules/xSharePoint/Modules/xSharePoint.DistributedCache/xSharePoint.DistributedCache.psm1 +++ /dev/null @@ -1,72 +0,0 @@ -function Add-xSharePointDistributedCacheServer() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [System.Uint32] - $CacheSizeInMB, - - [parameter(Mandatory = $true,Position=2)] - [System.String] - $ServiceAccount - ) - Initialize-xSharePointPSSnapin - - Add-SPDistributedCacheServiceInstance - Update-SPDistributedCacheSize -CacheSizeInMB $CacheSizeInMB - - $farm = Get-SPFarm - $cacheService = $farm.Services | Where-Object { $_.Name -eq "AppFabricCachingService" } - $cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser" - - $account = Get-SPManagedAccount -Identity $ServiceAccount - $cacheService.ProcessIdentity.ManagedAccount = $account - - Update-xSharePointDistributedCacheService -CacheService $cacheService -} - -function Update-xSharePointDistributedCacheService() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [object] - $CacheService - ) - $CacheService.ProcessIdentity.Update() - $CacheService.ProcessIdentity.Deploy() -} - -function Remove-xSharePointDistributedCacheServer() { - $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" - $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername } - $serviceInstance.Delete() - Initialize-xSharePointPSSnapin - Remove-SPDistributedCacheServiceInstance -} - -function Enable-xSharePointDCIcmpFireWallRule() { - $firewallRule = Get-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -ErrorAction SilentlyContinue - if($null -eq $firewallRule) { - New-NetFirewallRule -Name Allow_Ping -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -Description "Allow ICMPv4 ping" -Protocol ICMPv4 -IcmpType 8 -Enabled True -Profile Any -Action Allow - } - Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -} - -function Enable-xSharePointDCFireWallRule() { - $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -ErrorAction SilentlyContinue - if($null -eq $firewallRule) { - New-NetFirewallRule -Name "SPDistCache" -DisplayName "SharePoint Distributed Cache" -Protocol TCP -LocalPort 22233-22236 -Group "SharePoint" - } - Enable-NetFirewallRule -DisplayName "SharePoint Distributed Cache" -} - -function Disable-xSharePointDCFireWallRule() { - $firewallRule = Get-NetFirewallRule -DisplayName "SharePoint Distribute Cache" -ErrorAction SilentlyContinue - if($null -ne $firewallRule) { - Write-Verbose -Message "Disabling firewall rules." - Disable-NetFirewallRule -DisplayName "SharePoint Distribute Cache" - } -} - -Export-ModuleMember -Function * diff --git a/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 b/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 index dab52d34c..2b029a1fb 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.UserProfileService/xSharePoint.UserProfileService.psm1 @@ -47,29 +47,4 @@ function Remove-xSharePointUserToLocalAdmin() { ([ADSI]"WinNT://$($env:computername)/Administrators,group").Remove("WinNT://$domainName/$accountName") | Out-Null } -function Set-xSharePointUserProfileSyncMachine() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [string] - $UserProfileServiceAppName, - - [parameter(Mandatory = $true,Position=2)] - [Guid] - $SyncServiceId, - - [parameter(Mandatory = $true,Position=3)] - [PSCredential] - $FarmAccount - ) - Initialize-xSharePointPSSnapin - $serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue - if ($null -eq $serviceApps) { - return $null - } - $ups = $serviceApps | Where-Object { $_.TypeName -eq "User Profile Service Application" } - $ups.SetSynchronizationMachine($env:COMPUTERNAME, $SyncServiceId, $FarmAccount.UserName, $FarmAccount.GetNetworkCredential().Password) -} - Export-ModuleMember -Function * diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 81a314ddd..beb912521 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -1,4 +1,4 @@ -# +]# # Module manifest for module 'xSharePoint' # # Generated by: Brian Farnhill @@ -64,7 +64,6 @@ Description = 'This DSC module is used to deploy and configure SharePoint Server # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @("modules\xSharePoint.CacheAccounts\xSharePoint.CacheAccounts.psm1", - "modules\xSharePoint.DistributedCache\xSharePoint.DistributedCache.psm1", "modules\xSharePoint.UserProfileService\xSharePoint.UserProfileService.psm1", "modules\xSharePoint.Util\xSharePoint.Util.psm1") @@ -72,21 +71,15 @@ NestedModules = @("modules\xSharePoint.CacheAccounts\xSharePoint.CacheAccounts.p FunctionsToExport = '*' # Cmdlets to export from this module -CmdletsToExport = @("Add-xSharePointDistributedCacheServer", - "Remove-xSharePointDistributedCacheServer", - "Invoke-xSharePointCommand", +CmdletsToExport = @("Invoke-xSharePointCommand", "Get-xSharePointInstalledProductVersion", "Rename-xSharePointParamValue", "Update-xSharePointObject", "Set-xSharePointCacheReaderPolicy", "Set-xSharePointCacheOwnerPolicy", - "Enable-xSharePointDCIcmpFireWallRule", - "Enable-xSharePointDCFireWallRule", - "Disable-xSharePointDCFireWallRule", "Add-xSharePointUserToLocalAdmin", "Remove-xSharePointUserToLocalAdmin", "Test-xSharePointUserIsLocalAdmin", - "Set-xSharePointUserProfileSyncMachine", "Test-xSharePointSpecificParameters", "Initialize-xSharePointPSSnapin") diff --git a/Modules/xSharePoint/xSharePoint.pssproj b/Modules/xSharePoint/xSharePoint.pssproj index f246942c2..26dca94f6 100644 --- a/Modules/xSharePoint/xSharePoint.pssproj +++ b/Modules/xSharePoint/xSharePoint.pssproj @@ -77,7 +77,6 @@ - @@ -136,7 +135,6 @@ - From ec05e816da65de3ec345e6691cc99a670c21e650 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 18:59:17 +1000 Subject: [PATCH 66/69] Removed typo character --- Modules/xSharePoint/xSharePoint.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index beb912521..1d22f7597 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -1,4 +1,4 @@ -]# +# # Module manifest for module 'xSharePoint' # # Generated by: Brian Farnhill From e20309163e6465b9b198560f83ba14b19d52e060 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Fri, 25 Sep 2015 19:20:17 +1000 Subject: [PATCH 67/69] Refactored tests after module clean up --- .../MSFT_xSPDistributedCacheService.psm1 | 17 +++++++-- .../MSFT_xSPUserProfileSyncService.psm1 | 2 +- ...Point.xSPDistributedCacheService.Tests.ps1 | 37 ++++++++++--------- ...ePoint.xSPUserProfileSyncService.Tests.ps1 | 10 +++-- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index 7837a34d2..44ce222b1 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -108,10 +108,9 @@ function Set-TargetResource } else { Write-Verbose -Message "Removing distributed cache to the server" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { - $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" - $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq $instanceName -and ($_.Server.Name) -eq $env:computername } - $serviceInstance.Delete() - Initialize-xSharePointPSSnapin + $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService" -and ($_.Server.Name) -eq $env:computername } + Delete-DCacheService $serviceInstance + Remove-SPDistributedCacheServiceInstance } if ($CreateFirewallRules -eq $true) { @@ -139,6 +138,16 @@ function Update-DCacheService() { $CacheService.ProcessIdentity.Deploy() } +function Delete-DCacheService() { + [CmdletBinding()] + param + ( + [parameter(Mandatory = $true,Position=1)] + [object] + $CacheService + ) + $CacheService.Delete() +} function Test-TargetResource { diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index e239267c9..22a549cd6 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -86,7 +86,7 @@ function Set-TargetResource } $ups = $serviceApps | Where-Object { $_.TypeName -eq "User Profile Service Application" } - Set-UserProfileSyncMachine -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount + Set-UserProfileSyncMachine -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount -Ups $ups Start-SPServiceInstance -Identity $syncService.ID $desiredState = "Online" diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index d64f7f8e9..50b360ca3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -11,7 +11,6 @@ $Global:CurrentSharePointStubModule = $SharePointCmdletModule $ModuleName = "MSFT_xSPDistributedCacheService" Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\DSCResources\$ModuleName\$ModuleName.psm1") -Import-Module (Join-Path $RepoRoot "Modules\xSharePoint\Modules\xSharePoint.DistributedCache\xSharePoint.DistributedCache.psm1") Describe "xSPDistributedCacheService" { InModuleScope $ModuleName { @@ -24,7 +23,6 @@ Describe "xSPDistributedCacheService" { } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.DistributedCache" Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } @@ -35,20 +33,20 @@ Describe "xSPDistributedCacheService" { Mock Use-CacheCluster { } Mock Get-WmiObject { return @{ StartName = $testParams.ServiceAccount } } Mock Get-NetFirewallRule { return @{} } - Mock Get-NetFirewallRule { return @{} } -ModuleName "xSharePoint.DistributedCache" - Mock Enable-NetFirewallRule { } -ModuleName "xSharePoint.DistributedCache" - Mock New-NetFirewallRule { } -ModuleName "xSharePoint.DistributedCache" - Mock Disable-NetFirewallRule { } -ModuleName "xSharePoint.DistributedCache" - Mock Add-SPDistributedCacheServiceInstance { } -ModuleName "xSharePoint.DistributedCache" - Mock Update-SPDistributedCacheSize { } -ModuleName "xSharePoint.DistributedCache" - Mock Get-SPManagedAccount { return @{} } -ModuleName "xSharePoint.DistributedCache" + Mock Get-NetFirewallRule { return @{} } + Mock Enable-NetFirewallRule { } + Mock New-NetFirewallRule { } + Mock Disable-NetFirewallRule { } + Mock Add-SPDistributedCacheServiceInstance { } + Mock Update-SPDistributedCacheSize { } + Mock Get-SPManagedAccount { return @{} } Mock Get-SPFarm { return @{ Services = @(@{ Name = "AppFabricCachingService" ProcessIdentity = @{ ManagedAccount = $null } }) - } } -ModuleName "xSharePoint.DistributedCache" - Mock Update-xSharePointDistributedCacheService { } -ModuleName "xSharePoint.DistributedCache" + } } + Mock Update-DCacheService { } Context "Distributed cache is not configured" { @@ -64,7 +62,7 @@ Describe "xSPDistributedCacheService" { It "Sets up the cache correctly" { Set-TargetResource @testParams - Assert-MockCalled Add-SPDistributedCacheServiceInstance -ModuleName "xSharePoint.DistributedCache" + Assert-MockCalled Add-SPDistributedCacheServiceInstance } } @@ -88,7 +86,7 @@ Describe "xSPDistributedCacheService" { It "shuts down the distributed cache service" { Set-TargetResource @testParams - Assert-MockCalled Enable-NetFirewallRule -ModuleName "xSharePoint.DistributedCache" + Assert-MockCalled Enable-NetFirewallRule } } @@ -98,8 +96,13 @@ Describe "xSPDistributedCacheService" { Size = $testParams.CacheSizeInMB }} Mock Get-CacheHost { return @{ PortNo = 22233 } } - Mock Remove-xSharePointDistributedCacheServer { } - Mock Get-NetFirewallRule { return @{} } -ModuleName "xSharePoint.DistributedCache" + Mock Get-NetFirewallRule { return @{} } + Mock Get-SPServiceInstance { return @(@{ + Service = "SPDistributedCacheService Name=AppFabricCachingService" + Server = @{ Name = $env:COMPUTERNAME } + })} + Mock Delete-DCacheService { } + Mock Remove-SPDistributedCacheServiceInstance { } It "returns false from the test method" { Test-TargetResource @testParams | Should Be $false @@ -107,8 +110,8 @@ Describe "xSPDistributedCacheService" { It "shuts down the distributed cache service" { Set-TargetResource @testParams - Assert-MockCalled Remove-xSharePointDistributedCacheServer - Assert-MockCalled Disable-NetFirewallRule -ModuleName "xSharePoint.DistributedCache" + Assert-MockCalled Remove-SPDistributedCacheServiceInstance + Assert-MockCalled Disable-NetFirewallRule } } } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index 0d97e077c..f0349ebf3 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -55,7 +55,11 @@ Describe "xSPUserProfileSyncService" { TypeName = "User Profile Synchronization Service" }) } - } + } + Mock Get-SPServiceApplication { return @{ + ID = [Guid]::NewGuid() + TypeName = "User Profile Service Application" + } } It "returns absent from the get method" { $Global:xSharePointUPACheck = $false @@ -69,7 +73,7 @@ Describe "xSPUserProfileSyncService" { It "calls the start service cmdlet from the set method" { $Global:xSharePointUPACheck = $false - Mock Set-xSharePointUserProfileSyncMachine { } + Mock Set-UserProfileSyncMachine { } Set-TargetResource @testParams Assert-MockCalled Start-SPServiceInstance @@ -127,7 +131,7 @@ Describe "xSPUserProfileSyncService" { It "calls the start service cmdlet from the set method" { $Global:xSharePointUPACheck = $false - Mock Set-xSharePointUserProfileSyncMachine { } -ModuleName "xSharePoint.UserProfileService" + Mock Set-UserProfileSyncMachine { } Set-TargetResource @testParams Assert-MockCalled Stop-SPServiceInstance From 47f4a299a23732a423e9f88a03cc7f075db131bd Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Sat, 26 Sep 2015 22:24:00 +1000 Subject: [PATCH 68/69] Refactored method calls and test mocks --- .../MSFT_xSPDistributedCacheService.psm1 | 29 ++----------------- .../MSFT_xSPUserProfileSyncService.psm1 | 22 +------------- .../xSharePoint.Util/xSharePoint.Util.psm1 | 24 ++++++++------- ...Point.xSPDistributedCacheService.Tests.ps1 | 20 +++++++------ ...ePoint.xSPUserProfileSyncService.Tests.ps1 | 14 +++++---- 5 files changed, 36 insertions(+), 73 deletions(-) diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 index 44ce222b1..43c1fd263 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPDistributedCacheService/MSFT_xSPDistributedCacheService.psm1 @@ -101,15 +101,15 @@ function Set-TargetResource $account = Get-SPManagedAccount -Identity $params.ServiceAccount $cacheService.ProcessIdentity.ManagedAccount = $account - - Update-DCacheService $cacheService + $cacheService.ProcessIdentity.Update() + $cacheService.ProcessIdentity.Deploy() } } } else { Write-Verbose -Message "Removing distributed cache to the server" Invoke-xSharePointCommand -Credential $InstallAccount -ScriptBlock { $serviceInstance = Get-SPServiceInstance | Where-Object { ($_.Service.Tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService" -and ($_.Server.Name) -eq $env:computername } - Delete-DCacheService $serviceInstance + $serviceInstance.Delete() Remove-SPDistributedCacheServiceInstance } @@ -126,29 +126,6 @@ function Set-TargetResource } } -function Update-DCacheService() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [object] - $CacheService - ) - $CacheService.ProcessIdentity.Update() - $CacheService.ProcessIdentity.Deploy() -} - -function Delete-DCacheService() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=1)] - [object] - $CacheService - ) - $CacheService.Delete() -} - function Test-TargetResource { [CmdletBinding()] diff --git a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 index 22a549cd6..01d422ee3 100644 --- a/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 +++ b/Modules/xSharePoint/DSCResources/MSFT_xSPUserProfileSyncService/MSFT_xSPUserProfileSyncService.psm1 @@ -85,8 +85,8 @@ function Set-TargetResource throw [Exception] "No user profile service was found named $($params.UserProfileServiceAppName)" } $ups = $serviceApps | Where-Object { $_.TypeName -eq "User Profile Service Application" } + $ups.SetSynchronizationMachine($env:COMPUTERNAME, $syncService.ID, $params.FarmAccount.UserName, $params.FarmAccount.GetNetworkCredential().Password) - Set-UserProfileSyncMachine -SyncServiceId $syncService.ID -FarmAccount $params.FarmAccount -Ups $ups Start-SPServiceInstance -Identity $syncService.ID $desiredState = "Online" @@ -117,26 +117,6 @@ function Set-TargetResource } } -function Set-UserProfileSyncMachine() { - [CmdletBinding()] - param - ( - [parameter(Mandatory = $true,Position=2)] - [Guid] - $SyncServiceId, - - [parameter(Mandatory = $true,Position=3)] - [PSCredential] - $FarmAccount, - - [parameter(Mandatory = $true,Position=4)] - [object] - $Ups - ) - - $Ups.SetSynchronizationMachine($env:COMPUTERNAME, $SyncServiceId, $FarmAccount.UserName, $FarmAccount.GetNetworkCredential().Password) -} - function Test-TargetResource { [CmdletBinding()] diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 6571791fe..064e147ef 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -10,6 +10,7 @@ function Invoke-xSharePointCommand() { [HashTable] $Arguments, + [parameter(Mandatory = $true)] [ScriptBlock] $ScriptBlock @@ -18,7 +19,7 @@ function Invoke-xSharePointCommand() { $VerbosePreference = 'Continue' $invokeArgs = @{ - ScriptBlock = [ScriptBlock]::Create("Initialize-xSharePointPSSnapin; " + $ScriptBlock.ToString()) + ScriptBlock = [ScriptBlock]::Create("Initialize-xSharePointPSSnapin -Verbose; " + $ScriptBlock.ToString()) } if ($null -ne $Arguments) { $invokeArgs.Add("ArgumentList", $Arguments) @@ -45,7 +46,7 @@ function Invoke-xSharePointCommand() { #Running garbage collection to resolve issues related to Azure DSC extention use [GC]::Collect() - $session = New-PSSession -ComputerName $env:COMPUTERNAME -Credential $Credential -Authentication CredSSP -Name "Microsoft.SharePoint.DSC" -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -OperationTimeout 0 -IdleTimeout 60000) -ErrorAction Continue + $session = New-PSSession -ComputerName $env:COMPUTERNAME -Credential $Credential -Authentication CredSSP -Name "Microsoft.SharePoint.DSC" -SessionOption (New-PSSessionOption -OperationTimeout 0 -IdleTimeout 60000) -ErrorAction Continue if ($session) { $invokeArgs.Add("Session", $session) } @@ -57,18 +58,19 @@ function Invoke-xSharePointCommand() { } function Initialize-xSharePointPSSnapin() { + $VerbosePreference = "Continue" Write-Verbose "Checking for the powershell snapin" - if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) + if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) + { + Write-Verbose "Loading SharePoint PowerShell snapin" + try { - Write-Verbose "Loading SharePoint PowerShell snapin" - try - { - Add-PSSnapin "Microsoft.SharePoint.PowerShell" - } catch { - Write-Verbose ( $_ | Format-List | Out-String ) - } - + Add-PSSnapin "Microsoft.SharePoint.PowerShell" + } catch { + Write-Verbose ( $_ | Format-List | Out-String ) } + + } } function Rename-xSharePointParamValue() { diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 50b360ca3..2d3276742 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -43,11 +43,13 @@ Describe "xSPDistributedCacheService" { Mock Get-SPFarm { return @{ Services = @(@{ Name = "AppFabricCachingService" - ProcessIdentity = @{ ManagedAccount = $null } + ProcessIdentity = New-Object Object | + Add-Member NoteProperty ManagedAccount $null -PassThru | + Add-Member NoteProperty CurrentIdentityType $null -PassThru | + Add-Member ScriptMethod Update {} -PassThru | + Add-Member ScriptMethod Deploy {} -PassThru }) - } } - Mock Update-DCacheService { } - + } } Context "Distributed cache is not configured" { Mock Get-CacheHost { return $null } @@ -97,11 +99,11 @@ Describe "xSPDistributedCacheService" { }} Mock Get-CacheHost { return @{ PortNo = 22233 } } Mock Get-NetFirewallRule { return @{} } - Mock Get-SPServiceInstance { return @(@{ - Service = "SPDistributedCacheService Name=AppFabricCachingService" - Server = @{ Name = $env:COMPUTERNAME } - })} - Mock Delete-DCacheService { } + Mock Get-SPServiceInstance { return @(New-Object Object | + Add-Member NoteProperty Service "SPDistributedCacheService Name=AppFabricCachingService" -PassThru | + Add-Member NoteProperty Server @{ Name = $env:COMPUTERNAME } -PassThru | + Add-Member ScriptMethod Delete {} -PassThru + )} Mock Remove-SPDistributedCacheServiceInstance { } It "returns false from the test method" { diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index f0349ebf3..bdfe5f6a9 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -56,10 +56,14 @@ Describe "xSPUserProfileSyncService" { }) } } - Mock Get-SPServiceApplication { return @{ - ID = [Guid]::NewGuid() - TypeName = "User Profile Service Application" - } } + Mock Get-SPServiceApplication { return @( + New-Object Object | + Add-Member NoteProperty ID ([Guid]::Parse("21946987-5163-418f-b781-2beb83aa191f")) -PassThru | + Add-Member NoteProperty TypeName "User Profile Service Application" -PassThru | + Add-Member ScriptMethod SetSynchronizationMachine { + param($computerName, $syncServiceID, $FarmUserName, $FarmPassword) + } -PassThru + )} It "returns absent from the get method" { $Global:xSharePointUPACheck = $false @@ -73,7 +77,6 @@ Describe "xSPUserProfileSyncService" { It "calls the start service cmdlet from the set method" { $Global:xSharePointUPACheck = $false - Mock Set-UserProfileSyncMachine { } Set-TargetResource @testParams Assert-MockCalled Start-SPServiceInstance @@ -131,7 +134,6 @@ Describe "xSPUserProfileSyncService" { It "calls the start service cmdlet from the set method" { $Global:xSharePointUPACheck = $false - Mock Set-UserProfileSyncMachine { } Set-TargetResource @testParams Assert-MockCalled Stop-SPServiceInstance From 3fd03a4a6c9d4875df2921841556030b51531c37 Mon Sep 17 00:00:00 2001 From: Brian Farnhill Date: Sat, 26 Sep 2015 23:17:12 +1000 Subject: [PATCH 69/69] Removed referenced to initialize-xsharepointsnapin --- .../xSharePoint.Util/xSharePoint.Util.psm1 | 18 +----------------- Modules/xSharePoint/xSharePoint.psd1 | 3 +-- .../xSharePoint.xSPBCSServiceApp.Tests.ps1 | 2 +- .../xSharePoint.xSPCacheAccounts.Tests.ps1 | 2 +- .../xSharePoint.xSPCreateFarm.Tests.ps1 | 2 +- ...oint.xSPDiagnosticLoggingSettings.Tests.ps1 | 2 +- ...ePoint.xSPDistributedCacheService.Tests.ps1 | 2 +- .../xSharePoint.xSPFeature.Tests.ps1 | 2 +- .../xSharePoint.xSPInstall.Tests.ps1 | 2 +- .../xSharePoint.xSPInstallPrereqs.Tests.ps1 | 2 +- .../xSharePoint.xSPJoinFarm.Tests.ps1 | 2 +- .../xSharePoint.xSPManagedAccount.Tests.ps1 | 2 +- ...oint.xSPManagedMetadataServiceApp.Tests.ps1 | 2 +- .../xSharePoint.xSPManagedPath.Tests.ps1 | 2 +- .../xSharePoint.xSPSearchServiceApp.Tests.ps1 | 2 +- ...arePoint.xSPSecureStoreServiceApp.Tests.ps1 | 2 +- .../xSharePoint.xSPServiceAppPool.Tests.ps1 | 2 +- .../xSharePoint.xSPServiceInstance.Tests.ps1 | 2 +- .../xSharePoint/xSharePoint.xSPSite.Tests.ps1 | 2 +- .../xSharePoint.xSPStateServiceApp.Tests.ps1 | 2 +- ...arePoint.xSPUserProfileServiceApp.Tests.ps1 | 2 +- ...rePoint.xSPUserProfileSyncService.Tests.ps1 | 2 +- .../xSharePoint.xSPWebApplication.Tests.ps1 | 2 +- .../xSharePoint.xSPusageApplication.Tests.ps1 | 2 +- 24 files changed, 24 insertions(+), 41 deletions(-) diff --git a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 index 064e147ef..6f6ec46db 100644 --- a/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 +++ b/Modules/xSharePoint/Modules/xSharePoint.Util/xSharePoint.Util.psm1 @@ -19,7 +19,7 @@ function Invoke-xSharePointCommand() { $VerbosePreference = 'Continue' $invokeArgs = @{ - ScriptBlock = [ScriptBlock]::Create("Initialize-xSharePointPSSnapin -Verbose; " + $ScriptBlock.ToString()) + ScriptBlock = [ScriptBlock]::Create("if (`$null -eq (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue)) {Add-PSSnapin Microsoft.SharePoint.PowerShell}; " + $ScriptBlock.ToString()) } if ($null -ne $Arguments) { $invokeArgs.Add("ArgumentList", $Arguments) @@ -57,22 +57,6 @@ function Invoke-xSharePointCommand() { } } -function Initialize-xSharePointPSSnapin() { - $VerbosePreference = "Continue" - Write-Verbose "Checking for the powershell snapin" - if ($null -eq (Get-PSSnapin -Name "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)) - { - Write-Verbose "Loading SharePoint PowerShell snapin" - try - { - Add-PSSnapin "Microsoft.SharePoint.PowerShell" - } catch { - Write-Verbose ( $_ | Format-List | Out-String ) - } - - } -} - function Rename-xSharePointParamValue() { [CmdletBinding()] param diff --git a/Modules/xSharePoint/xSharePoint.psd1 b/Modules/xSharePoint/xSharePoint.psd1 index 1d22f7597..52963a2ea 100644 --- a/Modules/xSharePoint/xSharePoint.psd1 +++ b/Modules/xSharePoint/xSharePoint.psd1 @@ -80,8 +80,7 @@ CmdletsToExport = @("Invoke-xSharePointCommand", "Add-xSharePointUserToLocalAdmin", "Remove-xSharePointUserToLocalAdmin", "Test-xSharePointUserIsLocalAdmin", - "Test-xSharePointSpecificParameters", - "Initialize-xSharePointPSSnapin") + "Test-xSharePointSpecificParameters") # Variables to export from this module VariablesToExport = '*' diff --git a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 index 8e8095911..bd4d25a3b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPBCSServiceApp.Tests.ps1 @@ -27,7 +27,7 @@ Describe "xSPBCSServiceApp" { } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 index ec2148082..976d52a9f 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCacheAccounts.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPCacheAccounts" { SuperReaderAlias = "DEMO\SuperReader" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 index bd9680bdd..fc118d243 100644 --- a/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPCreateFarm.Tests.ps1 @@ -23,7 +23,7 @@ Describe "xSPCreateFarm" { CentralAdministrationPort = 1234 } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 index 326fbd9fa..42587234b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDiagnosticLoggingSettings.Tests.ps1 @@ -35,7 +35,7 @@ Describe "xSPDiagnosticLoggingSettings" { EventLogFloodProtectionNotifyInterval = 5 } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 index 2d3276742..8926cd417 100644 --- a/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPDistributedCacheService.Tests.ps1 @@ -22,7 +22,7 @@ Describe "xSPDistributedCacheService" { CreateFirewallRules = $true } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 index f84656125..6c9ed42e0 100644 --- a/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPFeature.Tests.ps1 @@ -26,7 +26,7 @@ Describe "xSPFeature" { Ensure = "Present" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 index 878e0895f..51c791728 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstall.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPInstall" { Ensure = "Present" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 index 76a17180d..f77d29e51 100644 --- a/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPInstallPrereqs.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPInstallPrereqs" { Ensure = "Present" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 index 66b36f5bf..c2ca83c4d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPJoinFarm" { Passphrase = "passphrase" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 index c1eb27e32..3e48f6950 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedAccount.Tests.ps1 @@ -22,7 +22,7 @@ Describe "xSPManagedAccount" { AccountName = "username" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 index eeef78fdd..26d36946c 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedMetadataServiceApp.Tests.ps1 @@ -21,7 +21,7 @@ Describe "xSPManagedMetaDataServiceApp" { DatabaseName = "SP_MMS" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 index aa08e2dce..f35840ab8 100644 --- a/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPManagedPath.Tests.ps1 @@ -21,7 +21,7 @@ Describe "xSPManagedPath" { HostHeader = $false } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 index 867714ea0..a59826a9b 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSearchServiceApp.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPSearchServiceApp" { ApplicationPool = "SharePoint Search Services" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 index dbc9ea890..4172b56a4 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSecureStoreServiceApp.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPSecureStoreServiceApp" { AuditingEnabled = $false } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 index b04d57344..990578005 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceAppPool.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPServiceAppPool" { ServiceAccount = "DEMO\svcSPServiceApps" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 index 466389c87..5e69f07a1 100644 --- a/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPServiceInstance.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPServiceInstance" { Ensure = "Present" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 index 5ef04b2b6..7f6af8826 100644 --- a/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPSite.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPSite" { OwnerAlias = "DEMO\User" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 index d0d11e9d6..1454092cd 100644 --- a/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPStateServiceApp.Tests.ps1 @@ -19,7 +19,7 @@ Describe "xSPStateServiceApp" { DatabaseName = "SP_StateService" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 index 21d2563db..329478f9d 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileServiceApp.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPUserProfileServiceApp" { FarmAccount = New-Object System.Management.Automation.PSCredential ("domain\username", (ConvertTo-SecureString "password" -AsPlainText -Force)) } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 index bdfe5f6a9..322e0e04a 100644 --- a/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPUserProfileSyncService.Tests.ps1 @@ -20,7 +20,7 @@ Describe "xSPUserProfileSyncService" { Ensure = "Present" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 index d235969c4..b2a6a83fe 100644 --- a/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPWebApplication.Tests.ps1 @@ -22,7 +22,7 @@ Describe "xSPWebApplication" { AuthenticationMethod = "NTLM" } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope } diff --git a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 index 32146ecd3..5d8e07ea4 100644 --- a/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 +++ b/Tests/xSharePoint/xSharePoint.xSPusageApplication.Tests.ps1 @@ -22,7 +22,7 @@ Describe "xSPUsageApplication" { UsageLogMaxSpaceGB = 10 } Import-Module (Join-Path ((Resolve-Path $PSScriptRoot\..\..).Path) "Modules\xSharePoint") - Mock Initialize-xSharePointPSSnapin { } -ModuleName "xSharePoint.Util" + Mock Invoke-xSharePointCommand { return Invoke-Command -ScriptBlock $ScriptBlock -ArgumentList $Arguments -NoNewScope }