Skip to content

Commit

Permalink
Merge pull request #844 from PowerShell/release-2.4
Browse files Browse the repository at this point in the history
Release 2.4
  • Loading branch information
kwirkykat authored Jul 25, 2018
2 parents 586ca8a + 7782217 commit 2ffec7c
Show file tree
Hide file tree
Showing 24 changed files with 1,877 additions and 803 deletions.
44 changes: 44 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Configuration for probot-stale - https://github.com/probot/stale

limitPerRun: 30

pulls:
daysUntilStale: 14
daysUntilClose: false
exemptProjects: true
exemptMilestones: true
staleLabel: abandoned
exemptLabels:
- needs review
- on hold
- waiting for CLA pass

markComment: >
Labeling this pull request (PR) as abandoned since it has gone 14 days or more
since the last update. An abandoned PR can be continued by another contributor.
The abandoned label will be removed if work on this PR is taken up again.
issues:
daysUntilStale: 30
daysUntilClose: 40
exemptProjects: true
exemptMilestones: true
staleLabel: stale
exemptLabels:
- bug
- enhancement
- tests
- documentation
- resource proposal
- on hold

markComment: >
This issue has been automatically marked as stale because
it has not had activity from the community in the last 30 days. It will be
closed if no further activity occurs within 10 days. If the issue is labelled
with any of the work labels (e.g bug, enhancement, documentation, or tests)
then the issue will not auto-close.
closeComment: >
This issue has been automatically closed because it is has not had activity
from the community in the last 40 days.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Change log for SharePointDsc

## 2.4

* SPCacheAccounts
* Fixed issue where the Test method would fail if SetWebAppPolicy was set to
false.
* SPDistributedCacheService
* Updated resource to allow updating the cache size
* SPFarm
* Implemented ability to deploy Central Administration site to a server at a
later point in time
* SPInfoPathFormsServiceConfig
* Fixed issue with trying to set the MaxSizeOfUserFormState parameter
* SPProductUpdate
* Fixed an issue where the resource failed when the search was already paused
* SPProjectServerLicense
* Fixed issue with incorrect detection of the license
* SPSearchContentSource
* Fixed issue where the Get method returned a conversion error when the content
source contained just one address
* Fixed issue 840 where the parameter StartHour was never taken into account
* SPSearchServiceApp
* Fixed issue where the service account was not set correctly when the service
application was first created
* Fixed issue where the Get method throws an error when the service app wasn't
created properly
* SPSearchTopology
* Fixed issue where Get method threw an error when the specified service
application didn't exist yet.
* SPServiceAppSecurity
* Fixed issue where error was thrown when no permissions were set on the
service application
* SPShellAdmins
* Updated documentation to specify required permissions for successfully using
this resource
* SPTrustedIdentityTokenIssuerProviderRealms
* Fixed code styling issues
* SPUserProfileServiceApp
* Fixed code styling issues

## 2.3

* Changes to SharePointDsc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Get-TargetResource
[Parameter()]
[System.Boolean]
$SetWebAppPolicy = $true,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount
Expand All @@ -29,7 +29,7 @@ function Get-TargetResource

$result = Invoke-SPDSCCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock {
$params = $args[0]

$wa = Get-SPWebApplication -Identity $params.WebAppUrl -ErrorAction SilentlyContinue

if ($null -eq $wa)
Expand All @@ -42,12 +42,12 @@ function Get-TargetResource
InstallAccount = $params.InstallAccount
}
}

$returnVal = @{
InstallAccount = $params.InstallAccount
WebAppUrl = $params.WebAppUrl
}

$policiesSet = $true
if ($wa.UseClaimsAuthentication -eq $true)
{
Expand Down Expand Up @@ -92,12 +92,12 @@ function Get-TargetResource
{
$policiesSet = $false
}

if ($wa.Policies.UserName -notcontains ((New-SPClaimsPrincipal -Identity $params.SuperUserAlias `
-IdentityType WindowsSamAccountName).ToEncodedString()))
{
$policiesSet = $false
}
}
}
else
{
Expand All @@ -109,7 +109,7 @@ function Get-TargetResource
{
$returnVal.Add("SuperUserAlias", "")
}

if ($wa.Properties.ContainsKey("portalsuperreaderaccount"))
{
$returnVal.Add("SuperReaderAlias", $wa.Properties["portalsuperreaderaccount"])
Expand All @@ -118,19 +118,19 @@ function Get-TargetResource
{
$returnVal.Add("SuperReaderAlias", "")
}

if ($wa.Policies.UserName -notcontains $params.SuperReaderAlias)
{
$policiesSet = $false
}

if ($wa.Policies.UserName -notcontains $params.SuperUserAlias)
{
$policiesSet = $false
}
}
$returnVal.Add("SetWebAppPolicy", $policiesSet)

return $returnVal
}
return $result
Expand All @@ -157,15 +157,15 @@ function Set-TargetResource
[Parameter()]
[System.Boolean]
$SetWebAppPolicy = $true,

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

Write-Verbose -Message "Setting cache accounts for $WebAppUrl"

$PSBoundParameters.SetWebAppPolicy = $SetWebAppPolicy

Invoke-SPDSCCommand -Credential $InstallAccount -Arguments $PSBoundParameters -ScriptBlock {
$params = $args[0]

Expand All @@ -174,7 +174,7 @@ function Set-TargetResource
{
throw [Exception] "The web applications $($params.WebAppUrl) can not be found to set cache accounts"
}

if ($wa.UseClaimsAuthentication -eq $true)
{
$wa.Properties["portalsuperuseraccount"] = (New-SPClaimsPrincipal -Identity $params.SuperUserAlias `
Expand All @@ -187,7 +187,7 @@ function Set-TargetResource
$wa.Properties["portalsuperuseraccount"] = $params.SuperUserAlias
$wa.Properties["portalsuperreaderaccount"] = $params.SuperReaderAlias
}

if ($params.SetWebAppPolicy -eq $true)
{
if ($wa.UseClaimsAuthentication -eq $true)
Expand All @@ -201,7 +201,7 @@ function Set-TargetResource
$policy = $wa.Policies.Add($claimsReader, "Super Reader (Claims)")
$policyRole = $wa.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullRead)
$policy.PolicyRoleBindings.Add($policyRole)

$claimsSuper = (New-SPClaimsPrincipal -Identity $params.SuperUserAlias `
-IdentityType WindowsSamAccountName).ToEncodedString()
if ($wa.Policies.UserName -contains $claimsSuper)
Expand All @@ -222,7 +222,7 @@ function Set-TargetResource
$readPolicy = $wa.Policies.Add($params.SuperReaderAlias, "Super Reader")
$readPolicyRole = $wa.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullRead)
$readPolicy.PolicyRoleBindings.Add($readPolicyRole)

if ($wa.Policies.UserName -contains $params.SuperUserAlias)
{
$wa.Policies.Remove($params.SuperUserAlias)
Expand All @@ -232,7 +232,7 @@ function Set-TargetResource
$policy.PolicyRoleBindings.Add($policyRole)
}
}

$wa.Update()
}
}
Expand All @@ -259,7 +259,7 @@ function Test-TargetResource
[Parameter()]
[System.Boolean]
$SetWebAppPolicy = $true,

[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount )
Expand All @@ -270,11 +270,21 @@ function Test-TargetResource

$CurrentValues = Get-TargetResource @PSBoundParameters

return Test-SPDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("SuperUserAlias", `
"SuperReaderAlias", `
"SetWebAppPolicy")
if ($SetWebAppPolicy -eq $true)
{
return Test-SPDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("SuperUserAlias", `
"SuperReaderAlias", `
"SetWebAppPolicy")
}
else
{
return Test-SPDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("SuperUserAlias", `
"SuperReaderAlias")
}
}

Export-ModuleMember -Function *-TargetResource
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function Set-TargetResource
$_.Status -eq "Online"
}

While (($count -lt $maxCount) -and ($null -eq $serviceCheck))
while (($count -lt $maxCount) -and ($null -eq $serviceCheck))
{
Write-Verbose -Message ("$([DateTime]::Now.ToShortTimeString()) - " + `
"Waiting for distributed cache to start " + `
Expand Down Expand Up @@ -258,7 +258,7 @@ function Set-TargetResource
$_.Status -ne "Disabled"
}

While (($count -lt $maxCount) -and ($null -ne $serviceCheck))
while (($count -lt $maxCount) -and ($null -ne $serviceCheck))
{
Write-Verbose -Message ("$([DateTime]::Now.ToShortTimeString()) - Waiting " + `
"for distributed cache to stop on all servers " + `
Expand All @@ -285,7 +285,7 @@ function Set-TargetResource
$_.Status -ne "Online"
}

While (($count -lt $maxCount) -and ($null -ne $serviceCheck))
while (($count -lt $maxCount) -and ($null -ne $serviceCheck))
{
Write-Verbose -Message ("$([DateTime]::Now.ToShortTimeString()) - Waiting " + `
"for distributed cache to start on all servers " + `
Expand Down Expand Up @@ -313,6 +313,67 @@ function Set-TargetResource
}
}
}
elseif ($CurrentState.CacheSizeInMB -ne $CacheSizeInMB)
{
Write-Verbose -Message "Updating distributed cache service cache size"
Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {
$params = $args[0]

Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance"
} | Stop-SPServiceInstance -Confirm:$false

$count = 0
$maxCount = 30

$serviceCheck = Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance" -and `
$_.Status -ne "Disabled"
}

while (($count -lt $maxCount) -and ($null -ne $serviceCheck))
{
Write-Verbose -Message ("$([DateTime]::Now.ToShortTimeString()) - Waiting " + `
"for distributed cache to stop on all servers " + `
"(waited $count of $maxCount minutes)")
Start-Sleep -Seconds 60
$serviceCheck = Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance" -and `
$_.Status -ne "Disabled"
}
$count++
}

Update-SPDistributedCacheSize -CacheSizeInMB $params.CacheSizeInMB

Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance"
} | Start-SPServiceInstance

$count = 0
$maxCount = 30

$serviceCheck = Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance" -and `
$_.Status -ne "Online"
}

while (($count -lt $maxCount) -and ($null -ne $serviceCheck))
{
Write-Verbose -Message ("$([DateTime]::Now.ToShortTimeString()) - Waiting " + `
"for distributed cache to start on all servers " + `
"(waited $count of $maxCount minutes)")
Start-Sleep -Seconds 60
$serviceCheck = Get-SPServiceInstance | Where-Object -FilterScript {
$_.GetType().Name -eq "SPDistributedCacheServiceInstance" -and `
$_.Status -ne "Online"
}
$count++
}
}
}
}
else
{
Expand Down Expand Up @@ -401,7 +462,9 @@ function Test-TargetResource
{
return Test-SPDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("Ensure", "CreateFirewallRules")
-ValuesToCheck @("Ensure", `
"CreateFirewallRules", `
"CacheSizeInMB")
}
else
{
Expand Down
Loading

0 comments on commit 2ffec7c

Please sign in to comment.