Skip to content

Commit

Permalink
Merge pull request #1084 from PowerShell/release-3.5
Browse files Browse the repository at this point in the history
SharePointDsc release v3.5
  • Loading branch information
kwirkykat authored Jun 26, 2019
2 parents bb74393 + 2ff8c84 commit d714e5b
Show file tree
Hide file tree
Showing 185 changed files with 6,456 additions and 5,712 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.preset": "Custom",
"editor.formatOnSave": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.exclude": {
Expand All @@ -21,4 +23,4 @@
"node_modules": true,
"markdownissues.txt": true
}
}
}
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Change log for SharePointDsc

## v3.5

* SharePointDsc generic
* Improved logging in all resource. They are now outputting
the current and targeted values in the Test method.
* Updated various resources to comply with coding style guidelines.
* Updated the following resources to not return Null from the Get
method anymore, but an hashtable which contains null values:
SPDesignerSettings, SPDiagnosticLoggingSettings, SPFarmAdministrators,
SPHealthAnalyzerRuleState, SPIrmSettings, SPOutgoingEmailSettings,
SPPasswordChangeSettings, SPSearchTopology, SPServiceAppProxyGroup,
SPTimerJobState, SPUserProfileSection, SPUserProfileSyncConnection,
SPWebAppBlockedFileTypes, SPWebApplicationAppDomain, SPWebAppPolicy,
SPWebAppSiteUseAndDeletion, SPWebAppThrottlingSettings,
SPWordAutomationServiceApp.
* SPConfigWizard
* Added check to make sure the Config Wizard is only executed when all
servers have the binaries installed.
* SPDistributedCacheService
* Added ability to check for incorrect service account.
* SPExcelServiceApp
* Fixes issue where Get method throws an error when the value of
PrivateBytesMax and UnusedObjectAgeMax are negative values.
* SPFarm
* Throw error in Get method if CentralAdministrationUrl is HTTP.
* SPInstallPrereqs
* Fixed bug in version check, where lower versions would be
detected as higher versions.
* SPProductUpdate
* Updated Readme to reflect the new patching possibilities added in v3.3.
* SPSecureStore
* Fixed issue where the test issue returned false is the service
application didn't exist, but the database name/server parameter
was specified.
* SPUserProfileSyncConnection
* Fixed issue where the parameter Server was checked in SP2016
but isn't used there and therefore always fails.
* SPWebAppAuthentication
* Updated the documentation to better explain the use of this resource
when using Classic authentication.

## v3.4

* SPDistributedCacheClientSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@ function Get-TargetResource
[System.String]
$DatabaseServer,

[Parameter()]
[ValidateSet("Present","Absent")]
[System.String]
[Parameter()]
[ValidateSet("Present","Absent")]
[System.String]
$Ensure = "Present",

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

Write-Verbose -Message "Getting Access Services service app '$Name'"

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

$serviceApps = Get-SPServiceApplication -Name $params.Name -ErrorAction SilentlyContinue
$nullReturn = @{
Name = $params.Name
ApplicationPool = $params.ApplicationPool
DatabaseServer = $params.DatabaseServer
Ensure = "Absent"
InstallAccount = $params.InstallAccount
}
if ($null -eq $serviceApps)
}
if ($null -eq $serviceApps)
{
return $nullReturn
return $nullReturn
}
$serviceApp = $serviceApps | Where-Object -FilterScript {
$_.GetType().FullName -eq "Microsoft.Office.Access.Services.MossHost.AccessServicesWebServiceApplication"
$_.GetType().FullName -eq "Microsoft.Office.Access.Services.MossHost.AccessServicesWebServiceApplication"
}

if ($null -eq $serviceApp)
if ($null -eq $serviceApp)
{
return $nullReturn
}
else
return $nullReturn
}
else
{
### Find database server name
$context = [Microsoft.SharePoint.SPServiceContext]::GetContext($serviceApp.ServiceApplicationProxyGroup, [Microsoft.SharePoint.SPSiteSubscriptionIdentifier]::Default)
Expand Down Expand Up @@ -86,24 +86,24 @@ function Set-TargetResource
[System.String]
$DatabaseServer,

[Parameter()]
[ValidateSet("Present","Absent")]
[System.String]
[Parameter()]
[ValidateSet("Present","Absent")]
[System.String]
$Ensure = "Present",

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

Write-Verbose -Message "Setting Access Services service app '$Name'"

$result = Get-TargetResource @PSBoundParameters

if ($result.Ensure -eq "Absent" -and $Ensure -eq "Present")
if ($result.Ensure -eq "Absent" -and $Ensure -eq "Present")
{
Write-Verbose -Message "Creating Access Services Application $Name"
Invoke-SPDSCCommand -Credential $InstallAccount `
Invoke-SPDscCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {

Expand All @@ -113,27 +113,27 @@ function Set-TargetResource
-ApplicationPool $params.ApplicationPool `
-Default `
-DatabaseServer $params.DatabaseServer

$app | New-SPAccessServicesApplicationProxy | Out-Null
}
}
if ($Ensure -eq "Absent")
if ($Ensure -eq "Absent")
{
Write-Verbose -Message "Removing Access Service Application $Name"
Invoke-SPDSCCommand -Credential $InstallAccount `
Invoke-SPDscCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {

$params = $args[0]

$app = Get-SPServiceApplication -Name $params.Name | Where-Object -FilterScript {
$_.GetType().FullName -eq "Microsoft.Office.Access.Services.MossHost.AccessServicesWebServiceApplication"
}

$proxies = Get-SPServiceApplicationProxy
foreach($proxyInstance in $proxies)
foreach ($proxyInstance in $proxies)
{
if($app.IsConnected($proxyInstance))
if ($app.IsConnected($proxyInstance))
{
$proxyInstance.Delete()
}
Expand Down Expand Up @@ -162,22 +162,25 @@ function Test-TargetResource
[System.String]
$DatabaseServer,

[Parameter()]
[ValidateSet("Present","Absent")]
[System.String]
[Parameter()]
[ValidateSet("Present","Absent")]
[System.String]
$Ensure = "Present",

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

Write-Verbose -Message "Testing for Access Service Application '$Name'"

$PSBoundParameters.Ensure = $Ensure

$CurrentValues = Get-TargetResource @PSBoundParameters

Write-Verbose -Message "Current Values: $(Convert-SPDscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-SPDscHashtableToString -Hashtable $PSBoundParameters)"

if ($CurrentValues.DatabaseServer -ne $DatabaseServer)
{
Write-Verbose -Message ("Specified database server does not match the actual " + `
Expand Down
Loading

0 comments on commit d714e5b

Please sign in to comment.