Skip to content

Commit

Permalink
Merge pull request #1028 from PowerShell/release-3.2
Browse files Browse the repository at this point in the history
Release v3.2
  • Loading branch information
kwirkykat authored Feb 20, 2019
2 parents af5f29b + c2ba666 commit d687e13
Show file tree
Hide file tree
Showing 138 changed files with 4,757 additions and 1,576 deletions.
14 changes: 7 additions & 7 deletions .vscode/RunPesterTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ $harnessPath = Join-Path -Path $PSScriptRoot `
Import-Module -Name $harnessPath -Force

$DscTestsPath = Join-Path -Path $PSScriptRoot `
-ChildPath "..\Modules\SharePointDsc\DscResource.Tests" `
-Resolve
if ((Test-Path $DscTestsPath) -eq $false)
-ChildPath "..\Modules\SharePointDsc\DscResource.Tests"

if ((Test-Path -Path $DscTestsPath) -eq $false)
{
Write-Warning -Message ("Unable to locate DscResource.Tests repo at '$DscTestsPath', " + `
"common DSC resource tests will not be executed")
$result = Invoke-TestHarness -IgnoreCodeCoverage
}
else
}
else
{
$result = Invoke-TestHarness -DscTestsPath $DscTestsPath -IgnoreCodeCoverage
}

if ($result.FailedCount -gt 0)
if ($result.FailedCount -gt 0)
{
Write-Output -InputObject "Failed test result summary:"
$result.TestResult | Where-Object -FilterScript {
$_.Passed -eq $false
$_.Passed -eq $false
} | ForEach-Object -Process {
Write-Output -InputObject "-----------------------------------------------------------"
$outputObject = @{
Expand Down
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
# Change log for SharePointDsc

## v3.2

* Changes to SharePointDsc unit testing
* Implemented Strict Mode version 1 for all code run during unit tests.
* Changed InstallAccount into PSDscRunAsCredential parameter in examples
* SPAuthenticationRealm
* New resource for setting farm authentication realm
* SPConfigWizard
* Updated PSConfig parameters according recommendations in blog post of
Stefan Gossner
* SPDistributedCacheService
* Fixed exception on Stop-SPServiceInstance with SharePoint 2019
* SPFarm
* Improved logging
* Added ability to manage the Developer Dashboard settings
* SPFarmSolution
* Fixed issue where uninstalling a solution would not work as expected if it
contained web application resources.
* SPIncomingEmailSettings
* New resource for configuring incoming email settings
* SPInstallPrereqs
* Improved logging
* Corrected detection for Windows Server 2019
* Corrected support for Windows Server 2019 for SharePoint 2016
* SPProductUpgrade
* Fixed issue where upgrading SP2013 would not properly detect the installed
version
* Fixed issue where the localized SharePoint 2019 CU was detected as a
Service Pack for a Language Pack
* SPSearchAuthorativePage
* Fixed issue where modifying search query would not target the correct
search application
* SPSearchResultSource
* Updated resource to allow localized ProviderTypes
* SPServiceAppSecurity
* Updated resource to allow localized permission levels
* SPServiceInstance
* Added -All switch to resolve "Unable to locate service application" in SP2013
* SPSite
* Improved logging
* SPUserProfileProperty
* Fix user profile property mappings does not work
* SPUserProfileServiceApp
* Added warning message when MySiteHostLocation is not specified. This is
currently not required, which results in an error. Will be corrected in
SPDsc v4.0 (is a breaking change).
* SPUserProfileSyncConnection
* Fixed issue where test resource never would return true for any configurations
on SharePoint 2016/2019
* Fixed issue where updating existing connection never would work for any
configurations on SharePoint 2016/2019
* Updated documentation to reflect that Fore will not impact configurations for
SharePoint 2016/2019. Updated the test method accordingly.
* SPUserProfileSyncService
* Fixed issue where failure to configure the sync service would not throw error
* SPWebAppPeoplePickerSettings
* Converted password for access account to secure string. Previsouly
the resource would fail setting the password and an exeption was thrown that
printed the password in clear text.
* SPWebAppPolicy
* Fixed issue where parameter MembersToExclude did not work as expected
* SPWorkflowService
* Added support for specifying scope name.
* Added support for detecting incorrect configuration for scope name and
WorkflowHostUri

## v3.1

* Changes to SharePointDsc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
function Get-TargetResource()
{
[CmdletBinding()]
[OutputType([System.Collections.HashTable])]
param (
[Parameter(Mandatory = $true)]
[ValidateSet('Yes')]
[String]
$IsSingleInstance,

[Parameter(Mandatory = $true)]
[String]
$AuthenticationRealm,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
)

Write-Verbose -Message "Getting farm authentication realm"

$result = Invoke-SPDSCCommand -Credential $InstallAccount `
-ScriptBlock {
$currentRealm = Get-SPAuthenticationRealm

Write-Verbose -Message "Current farm authentication realm is '$currentRealm'"

return @{
IsSingleInstance = "Yes"
AuthenticationRealm = $currentRealm
}
}

return $result
}

function Set-TargetResource()
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateSet('Yes')]
[String]
$IsSingleInstance,

[Parameter(Mandatory = $true)]
[String]
$AuthenticationRealm,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
)

Write-Verbose -Message "Setting farm authentication realm to $AuthenticationRealm"

Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {

$params = $args[0]
Set-SPAuthenticationRealm -Realm $params.AuthenticationRealm
}
}

function Test-TargetResource()
{
[CmdletBinding()]
[OutputType([System.Boolean])]
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateSet('Yes')]
[String]
$IsSingleInstance,

[Parameter(Mandatory = $true)]
[String]
$AuthenticationRealm,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
)

Write-Verbose -Message "Testing farm authentication realm"

$CurrentValues = Get-TargetResource @PSBoundParameters

return Test-SPDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("AuthenticationRealm")
}

Export-ModuleMember -Function *-TargetResource
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ClassVersion("1.0.0.0"), FriendlyName("SPAuthenticationRealm")]
class MSFT_SPAuthenticationRealm : OMI_BaseResource
{
[Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance;
[Required, Description("The authentication realm to be set")] String AuthenticationRealm;
[Write, Description("POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5"), EmbeddedInstance("MSFT_Credential")] String InstallAccount;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Description

**Type:** Distributed
**Requires CredSSP:** No

This resource is used to set the authentication realm for a farm.
By default the authentication realm for a new farm installation
is the same as the farm id.

Note:

SharePoint automatically converts the realm to lower case ASCII printable characters.
The specified authentication realm must therefore conform to this for the test
method to be able to detect a correct configuration.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ function Get-TargetResource
{
Write-Verbose -Message "Server isn't running the Web Application role"
return @{
WebAppUrl = $null
Zone = $null
EnableCache = $false
Location = $null
MaxSizeInGB = $null
WebAppUrl = $null
Zone = $null
EnableCache = $false
Location = $null
MaxSizeInGB = $null
MaxAgeInSeconds = $null
FileTypes = $null
InstallAccount = $params.InstallAccount
FileTypes = $null
InstallAccount = $params.InstallAccount
}
}

Expand All @@ -74,21 +74,21 @@ function Get-TargetResource
{
Write-Verbose -Message "Specified web application was not found."
return @{
WebAppUrl = $null
Zone = $null
EnableCache = $false
Location = $null
MaxSizeInGB = $null
WebAppUrl = $null
Zone = $null
EnableCache = $false
Location = $null
MaxSizeInGB = $null
MaxAgeInSeconds = $null
FileTypes = $null
InstallAccount = $params.InstallAccount
FileTypes = $null
InstallAccount = $params.InstallAccount
}
}

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

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

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

Expand Down Expand Up @@ -128,14 +128,14 @@ function Get-TargetResource
}

$returnval = @{
WebAppUrl = $params.WebAppUrl
Zone = $params.Zone
EnableCache = $cacheEnabled
Location = $webconfig.configuration.SharePoint.BlobCache.location
MaxSizeInGB = $maxsize
WebAppUrl = $params.WebAppUrl
Zone = $params.Zone
EnableCache = $cacheEnabled
Location = $webconfig.configuration.SharePoint.BlobCache.location
MaxSizeInGB = $maxsize
MaxAgeInSeconds = $maxage
FileTypes = $webconfig.configuration.SharePoint.BlobCache.path
InstallAccount = $params.InstallAccount
FileTypes = $webconfig.configuration.SharePoint.BlobCache.path
InstallAccount = $params.InstallAccount
}

return $returnval
Expand Down Expand Up @@ -260,7 +260,7 @@ function Set-TargetResource

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

$sitePath = $wa.IisSettings[$zone].Path
$sitePath = $wa.IisSettings[$zone].Path
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
$webconfiglocation = Join-Path -Path $sitePath -ChildPath "web.config"
$webconfigbackuplocation = Join-Path -Path $sitePath -ChildPath "web_config-$timestamp.backup"
Expand Down Expand Up @@ -299,7 +299,7 @@ function Set-TargetResource
## Check Blob Cache folder
if ($Location)
{
if ( -not (Test-Path -Path $Location))
if (-not (Test-Path -Path $Location))
{
Write-Verbose "Create Blob Cache Folder $Location"
try
Expand Down Expand Up @@ -362,7 +362,7 @@ function Test-TargetResource

if ($Location)
{
if ( -not (Test-Path -Path $Location))
if (-not (Test-Path -Path $Location))
{
Write-Verbose "Blob Cache Folder $Location does not exist"
return $false
Expand Down
Loading

0 comments on commit d687e13

Please sign in to comment.