Skip to content

Commit d687e13

Browse files
authored
Merge pull request #1028 from PowerShell/release-3.2
Release v3.2
2 parents af5f29b + c2ba666 commit d687e13

File tree

138 files changed

+4757
-1576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+4757
-1576
lines changed

.vscode/RunPesterTests.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ $harnessPath = Join-Path -Path $PSScriptRoot `
55
Import-Module -Name $harnessPath -Force
66

77
$DscTestsPath = Join-Path -Path $PSScriptRoot `
8-
-ChildPath "..\Modules\SharePointDsc\DscResource.Tests" `
9-
-Resolve
10-
if ((Test-Path $DscTestsPath) -eq $false)
8+
-ChildPath "..\Modules\SharePointDsc\DscResource.Tests"
9+
10+
if ((Test-Path -Path $DscTestsPath) -eq $false)
1111
{
1212
Write-Warning -Message ("Unable to locate DscResource.Tests repo at '$DscTestsPath', " + `
1313
"common DSC resource tests will not be executed")
1414
$result = Invoke-TestHarness -IgnoreCodeCoverage
15-
}
16-
else
15+
}
16+
else
1717
{
1818
$result = Invoke-TestHarness -DscTestsPath $DscTestsPath -IgnoreCodeCoverage
1919
}
2020

21-
if ($result.FailedCount -gt 0)
21+
if ($result.FailedCount -gt 0)
2222
{
2323
Write-Output -InputObject "Failed test result summary:"
2424
$result.TestResult | Where-Object -FilterScript {
25-
$_.Passed -eq $false
25+
$_.Passed -eq $false
2626
} | ForEach-Object -Process {
2727
Write-Output -InputObject "-----------------------------------------------------------"
2828
$outputObject = @{

CHANGELOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,71 @@
11
# Change log for SharePointDsc
22

3+
## v3.2
4+
5+
* Changes to SharePointDsc unit testing
6+
* Implemented Strict Mode version 1 for all code run during unit tests.
7+
* Changed InstallAccount into PSDscRunAsCredential parameter in examples
8+
* SPAuthenticationRealm
9+
* New resource for setting farm authentication realm
10+
* SPConfigWizard
11+
* Updated PSConfig parameters according recommendations in blog post of
12+
Stefan Gossner
13+
* SPDistributedCacheService
14+
* Fixed exception on Stop-SPServiceInstance with SharePoint 2019
15+
* SPFarm
16+
* Improved logging
17+
* Added ability to manage the Developer Dashboard settings
18+
* SPFarmSolution
19+
* Fixed issue where uninstalling a solution would not work as expected if it
20+
contained web application resources.
21+
* SPIncomingEmailSettings
22+
* New resource for configuring incoming email settings
23+
* SPInstallPrereqs
24+
* Improved logging
25+
* Corrected detection for Windows Server 2019
26+
* Corrected support for Windows Server 2019 for SharePoint 2016
27+
* SPProductUpgrade
28+
* Fixed issue where upgrading SP2013 would not properly detect the installed
29+
version
30+
* Fixed issue where the localized SharePoint 2019 CU was detected as a
31+
Service Pack for a Language Pack
32+
* SPSearchAuthorativePage
33+
* Fixed issue where modifying search query would not target the correct
34+
search application
35+
* SPSearchResultSource
36+
* Updated resource to allow localized ProviderTypes
37+
* SPServiceAppSecurity
38+
* Updated resource to allow localized permission levels
39+
* SPServiceInstance
40+
* Added -All switch to resolve "Unable to locate service application" in SP2013
41+
* SPSite
42+
* Improved logging
43+
* SPUserProfileProperty
44+
* Fix user profile property mappings does not work
45+
* SPUserProfileServiceApp
46+
* Added warning message when MySiteHostLocation is not specified. This is
47+
currently not required, which results in an error. Will be corrected in
48+
SPDsc v4.0 (is a breaking change).
49+
* SPUserProfileSyncConnection
50+
* Fixed issue where test resource never would return true for any configurations
51+
on SharePoint 2016/2019
52+
* Fixed issue where updating existing connection never would work for any
53+
configurations on SharePoint 2016/2019
54+
* Updated documentation to reflect that Fore will not impact configurations for
55+
SharePoint 2016/2019. Updated the test method accordingly.
56+
* SPUserProfileSyncService
57+
* Fixed issue where failure to configure the sync service would not throw error
58+
* SPWebAppPeoplePickerSettings
59+
* Converted password for access account to secure string. Previsouly
60+
the resource would fail setting the password and an exeption was thrown that
61+
printed the password in clear text.
62+
* SPWebAppPolicy
63+
* Fixed issue where parameter MembersToExclude did not work as expected
64+
* SPWorkflowService
65+
* Added support for specifying scope name.
66+
* Added support for detecting incorrect configuration for scope name and
67+
WorkflowHostUri
68+
369
## v3.1
470

571
* Changes to SharePointDsc
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
function Get-TargetResource()
2+
{
3+
[CmdletBinding()]
4+
[OutputType([System.Collections.HashTable])]
5+
param (
6+
[Parameter(Mandatory = $true)]
7+
[ValidateSet('Yes')]
8+
[String]
9+
$IsSingleInstance,
10+
11+
[Parameter(Mandatory = $true)]
12+
[String]
13+
$AuthenticationRealm,
14+
15+
[Parameter()]
16+
[System.Management.Automation.PSCredential]
17+
$InstallAccount
18+
)
19+
20+
Write-Verbose -Message "Getting farm authentication realm"
21+
22+
$result = Invoke-SPDSCCommand -Credential $InstallAccount `
23+
-ScriptBlock {
24+
$currentRealm = Get-SPAuthenticationRealm
25+
26+
Write-Verbose -Message "Current farm authentication realm is '$currentRealm'"
27+
28+
return @{
29+
IsSingleInstance = "Yes"
30+
AuthenticationRealm = $currentRealm
31+
}
32+
}
33+
34+
return $result
35+
}
36+
37+
function Set-TargetResource()
38+
{
39+
[CmdletBinding()]
40+
param (
41+
[Parameter(Mandatory = $true)]
42+
[ValidateSet('Yes')]
43+
[String]
44+
$IsSingleInstance,
45+
46+
[Parameter(Mandatory = $true)]
47+
[String]
48+
$AuthenticationRealm,
49+
50+
[Parameter()]
51+
[System.Management.Automation.PSCredential]
52+
$InstallAccount
53+
)
54+
55+
Write-Verbose -Message "Setting farm authentication realm to $AuthenticationRealm"
56+
57+
Invoke-SPDSCCommand -Credential $InstallAccount `
58+
-Arguments $PSBoundParameters `
59+
-ScriptBlock {
60+
61+
$params = $args[0]
62+
Set-SPAuthenticationRealm -Realm $params.AuthenticationRealm
63+
}
64+
}
65+
66+
function Test-TargetResource()
67+
{
68+
[CmdletBinding()]
69+
[OutputType([System.Boolean])]
70+
[CmdletBinding()]
71+
param (
72+
[Parameter(Mandatory = $true)]
73+
[ValidateSet('Yes')]
74+
[String]
75+
$IsSingleInstance,
76+
77+
[Parameter(Mandatory = $true)]
78+
[String]
79+
$AuthenticationRealm,
80+
81+
[Parameter()]
82+
[System.Management.Automation.PSCredential]
83+
$InstallAccount
84+
)
85+
86+
Write-Verbose -Message "Testing farm authentication realm"
87+
88+
$CurrentValues = Get-TargetResource @PSBoundParameters
89+
90+
return Test-SPDscParameterState -CurrentValues $CurrentValues `
91+
-DesiredValues $PSBoundParameters `
92+
-ValuesToCheck @("AuthenticationRealm")
93+
}
94+
95+
Export-ModuleMember -Function *-TargetResource
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[ClassVersion("1.0.0.0"), FriendlyName("SPAuthenticationRealm")]
2+
class MSFT_SPAuthenticationRealm : OMI_BaseResource
3+
{
4+
[Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance;
5+
[Required, Description("The authentication realm to be set")] String AuthenticationRealm;
6+
[Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount;
7+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Description
2+
3+
**Type:** Distributed
4+
**Requires CredSSP:** No
5+
6+
This resource is used to set the authentication realm for a farm.
7+
By default the authentication realm for a new farm installation
8+
is the same as the farm id.
9+
10+
Note:
11+
12+
SharePoint automatically converts the realm to lower case ASCII printable characters.
13+
The specified authentication realm must therefore conform to this for the test
14+
method to be able to detect a correct configuration.

Modules/SharePointDsc/DSCResources/MSFT_SPBlobCacheSettings/MSFT_SPBlobCacheSettings.psm1

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ function Get-TargetResource
5656
{
5757
Write-Verbose -Message "Server isn't running the Web Application role"
5858
return @{
59-
WebAppUrl = $null
60-
Zone = $null
61-
EnableCache = $false
62-
Location = $null
63-
MaxSizeInGB = $null
59+
WebAppUrl = $null
60+
Zone = $null
61+
EnableCache = $false
62+
Location = $null
63+
MaxSizeInGB = $null
6464
MaxAgeInSeconds = $null
65-
FileTypes = $null
66-
InstallAccount = $params.InstallAccount
65+
FileTypes = $null
66+
InstallAccount = $params.InstallAccount
6767
}
6868
}
6969

@@ -74,21 +74,21 @@ function Get-TargetResource
7474
{
7575
Write-Verbose -Message "Specified web application was not found."
7676
return @{
77-
WebAppUrl = $null
78-
Zone = $null
79-
EnableCache = $false
80-
Location = $null
81-
MaxSizeInGB = $null
77+
WebAppUrl = $null
78+
Zone = $null
79+
EnableCache = $false
80+
Location = $null
81+
MaxSizeInGB = $null
8282
MaxAgeInSeconds = $null
83-
FileTypes = $null
84-
InstallAccount = $params.InstallAccount
83+
FileTypes = $null
84+
InstallAccount = $params.InstallAccount
8585
}
8686
}
8787

8888
$zone = [Microsoft.SharePoint.Administration.SPUrlZone]::$($params.Zone)
8989

9090
$sitePath = $wa.IisSettings[$zone].Path
91-
$webconfiglocation = Join-Path $sitePath "web.config"
91+
$webconfiglocation = Join-Path -Path $sitePath -ChildPath "web.config"
9292

9393
[xml]$webConfig = Get-Content -Path $webConfigLocation
9494

@@ -128,14 +128,14 @@ function Get-TargetResource
128128
}
129129

130130
$returnval = @{
131-
WebAppUrl = $params.WebAppUrl
132-
Zone = $params.Zone
133-
EnableCache = $cacheEnabled
134-
Location = $webconfig.configuration.SharePoint.BlobCache.location
135-
MaxSizeInGB = $maxsize
131+
WebAppUrl = $params.WebAppUrl
132+
Zone = $params.Zone
133+
EnableCache = $cacheEnabled
134+
Location = $webconfig.configuration.SharePoint.BlobCache.location
135+
MaxSizeInGB = $maxsize
136136
MaxAgeInSeconds = $maxage
137-
FileTypes = $webconfig.configuration.SharePoint.BlobCache.path
138-
InstallAccount = $params.InstallAccount
137+
FileTypes = $webconfig.configuration.SharePoint.BlobCache.path
138+
InstallAccount = $params.InstallAccount
139139
}
140140

141141
return $returnval
@@ -260,7 +260,7 @@ function Set-TargetResource
260260

261261
$zone = [Microsoft.SharePoint.Administration.SPUrlZone]::$($params.Zone)
262262

263-
$sitePath = $wa.IisSettings[$zone].Path
263+
$sitePath = $wa.IisSettings[$zone].Path
264264
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
265265
$webconfiglocation = Join-Path -Path $sitePath -ChildPath "web.config"
266266
$webconfigbackuplocation = Join-Path -Path $sitePath -ChildPath "web_config-$timestamp.backup"
@@ -299,7 +299,7 @@ function Set-TargetResource
299299
## Check Blob Cache folder
300300
if ($Location)
301301
{
302-
if ( -not (Test-Path -Path $Location))
302+
if (-not (Test-Path -Path $Location))
303303
{
304304
Write-Verbose "Create Blob Cache Folder $Location"
305305
try
@@ -362,7 +362,7 @@ function Test-TargetResource
362362

363363
if ($Location)
364364
{
365-
if ( -not (Test-Path -Path $Location))
365+
if (-not (Test-Path -Path $Location))
366366
{
367367
Write-Verbose "Blob Cache Folder $Location does not exist"
368368
return $false

0 commit comments

Comments
 (0)