Skip to content

Commit

Permalink
Merge pull request #441 from PowerShell/release-1.4
Browse files Browse the repository at this point in the history
Release 1.4
  • Loading branch information
kwirkykat authored Nov 2, 2016
2 parents 58559de + 83e1584 commit c4553e8
Show file tree
Hide file tree
Showing 193 changed files with 15,670 additions and 9,580 deletions.
127 changes: 127 additions & 0 deletions .appveyor/appveyor.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
function Start-AppveyorInstallTask
{
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Pester -Force
Start-Process -Wait -FilePath "git" -ArgumentList @(
"clone",
"-q",
"https://github.com/PowerShell/DscResource.Tests",
(Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "Modules\SharePointDsc\DscResource.Tests")
)
Start-Process -Wait -FilePath "git" -ArgumentList @(
"clone",
"-q",
"https://github.com/PowerShell/DscResources",
(Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "DscResources")
)
$testHelperPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "Modules\SharePointDsc\DscResource.Tests\TestHelper.psm1"
Import-Module -Name $testHelperPath -Force
}

function Start-AppveyorTestScriptTask
{
$testResultsFile = ".\TestsResults.xml"
$testHarnessPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "\Tests\Unit\SharePointDsc.TestHarness.psm1"
$dscTestsPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "Modules\SharePointDsc\DscResource.Tests"
Import-Module -Name $testHarnessPath

$result = Invoke-SPDscUnitTestSuite -TestResultsFile $testResultsFile `
-DscTestsPath $dscTestsPath

$webClient = New-Object -TypeName "System.Net.WebClient"

$testResultsFilePath = Resolve-Path -Path $testResultsFile
$webClient.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)",
$testResultsFilePath)

if ($result.FailedCount -gt 0)
{
throw "$($result.FailedCount) tests failed."
}
}

function Start-AppveyorAfterTestTask
{
# Move the DSC resource tests folder out so it isn't included in the ZIP module that is made
$dscTestsPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "Modules\SharePointDsc\DscResource.Tests"
Move-Item -Path $dscTestsPath -Destination $env:APPVEYOR_BUILD_FOLDER

# Import the module again from its new location
$testHelperPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "DscResource.Tests\TestHelper.psm1"
Import-Module -Name $testHelperPath -Force

$mainModulePath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "modules\SharePointDsc"

# Write the PowerShell help files
$docoPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "modules\SharePointDsc\en-US"
New-Item -Path $docoPath -ItemType Directory
$docoHelperPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
-ChildPath "DscResources\DscResource.DocumentationHelper"
Import-Module -Name $docoHelperPath
Write-DscResourcePowerShellHelp -OutputPath $docoPath -ModulePath $mainModulePath -Verbose

# Import so we can create zip files
Add-Type -assemblyname System.IO.Compression.FileSystem

# Generate the wiki content for the release and zip/publish it to appveyor
$wikiContentPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "wikicontent"
New-Item -Path $wikiContentPath -ItemType Directory
Write-DscResourceWikiSite -OutputPath $wikiContentPath -ModulePath $mainModulePath -Verbose

$zipFileName = "SharePointDsc_$($env:APPVEYOR_BUILD_VERSION)_wikicontent.zip"
[System.IO.Compression.ZipFile]::CreateFromDirectory($wikiContentPath,
"$env:APPVEYOR_BUILD_FOLDER\$zipFileName")
Get-ChildItem -Path "$env:APPVEYOR_BUILD_FOLDER\$zipFileName" | ForEach-Object -Process {
Push-AppveyorArtifact $_.FullName -FileName $_.Name
}

# Remove the readme files that are used to generate documentation so they aren't shipped
$readmePaths = "$env:APPVEYOR_BUILD_FOLDER\Modules\**\readme.md"
Get-ChildItem -Path $readmePaths -Recurse | Remove-Item -Confirm:$false

# Add the appropriate build number to the manifest and zip/publish everything to appveyor
$manifest = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "modules\SharePointDsc\SharePointDsc.psd1"
(Get-Content $manifest -Raw).Replace("1.4.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
$zipFileName = "SharePointDsc_$($env:APPVEYOR_BUILD_VERSION).zip"
[System.IO.Compression.ZipFile]::CreateFromDirectory($mainModulePath, "$env:APPVEYOR_BUILD_FOLDER\$zipFileName")
New-DscChecksum -Path $env:APPVEYOR_BUILD_FOLDER -Outpath $env:APPVEYOR_BUILD_FOLDER
Get-ChildItem -Path "$env:APPVEYOR_BUILD_FOLDER\$zipFileName" | ForEach-Object -Process {
Push-AppveyorArtifact $_.FullName -FileName $_.Name
}
Get-ChildItem -Path "$env:APPVEYOR_BUILD_FOLDER\$zipFileName.checksum" | ForEach-Object -Process {
Push-AppveyorArtifact $_.FullName -FileName $_.Name
}

Set-Location -Path $mainModulePath
$nuspecParams = @{
packageName = "SharePointDsc"
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 = "SharePointDsc"
tags = "DesiredStateConfiguration DSC DSCResourceKit"
destinationPath = "."
}
New-Nuspec @nuspecParams

Start-Process -FilePath "nuget" -Wait -ArgumentList @(
"pack",
".\SharePointDsc.nuspec",
"-outputdirectory $env:APPVEYOR_BUILD_FOLDER"
)
$nuGetPackageName = "SharePointDsc." + $env:APPVEYOR_BUILD_VERSION + ".nupkg"
Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\$nuGetPackageName" | ForEach-Object -Process {
Push-AppveyorArtifact $_.FullName -FileName $_.Name
}
}

Export-ModuleMember -Function *
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To aid community reviewers in reviewing and merging your PR, please take the tim
- [ ] Change details added to Unreleased section of changelog.md?
- [ ] Added/updated documentation and descriptions in .schema.mof files where appropriate?
- [ ] Examples updated for both the single server and small farm templates in the examples folder?
- [ ] New/changed code adheres to [Style Guidelines]?(https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)?
- [ ] New/changed code adheres to [Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)?
- [ ] [Unit and Integration tests](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md) created/updated where possible?

**DELETE THIS LINE AND BELOW**
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Change log for SharePointDsc

### 1.4
* Set-TargetResource of Service Application now also removes all associated proxies
* Fixed issue with all SPServiceApplication for OS not in En-Us language, add GetType().FullName method in:
- SPAccessServiceApp
- SPAppManagementServiceApp
- SPBCSServiceApp
- SPExcelServiceApp
- SPManagedMetaDataServiceApp
- SPPerformancePointServiceApp
- SPSearchServiceApp
- SPSearchCrawlRule
- SPSecureStoreServiceApp
- SPSubscriptionSettingsServiceApp
- SPUsageApplication
- SPUserProfileServiceApp
- SPVisioServiceApp
- SPWordAutomationServiceApp
- SPWorkManagementServiceApp
* Fixed issue with SPServiceInstance for OS not in En-Us language, add GetType().Name method in:
- SPDistributedCacheService
- SPUserProfileSyncService
* Fixed issue with SPInstallLanguagePack to install before farm creation
* Fixed issue with mounting SPContentDatabase
* Fixed issue with SPShellAdmin and Content Database method
* Fixed issue with SPServiceInstance (Set-TargetResource) for OS not in En-Us language
* Added .Net 4.6 support check to SPInstall and SPInstallPrereqs
* Improved code styling
* SPVisioServiceapplication now creates proxy and lets you specify a name for it
* New resources: SPAppStoreSettings
* Fixed bug with SPInstallPrereqs to allow minor version changes to prereqs for SP2016
* Refactored unit tests to consolidate and streamline test approaches
* Updated SPExcelServiceApp resource to add support for trusted file locations and most other properties of the service app
* Added support to SPMetadataServiceApp to allow changing content type hub URL on existing service apps
* Fixed a bug that would cause SPSearchResultSource to throw exceptions when the enterprise search centre URL has not been set
* Updated documentation of SPProductUpdate to reflect the required install order of product updates

### 1.3
* Fixed typo on return value in SPServiceAppProxyGroup
* Fixed SPJoinFarm to not write output during successful farm join
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Get-TargetResource
return $nullReturn
}
$serviceApp = $serviceApps | Where-Object -FilterScript {
$_.TypeName -eq "Access Services Web Service Application"
$_.GetType().FullName -eq "Microsoft.Office.Access.Services.MossHost.AccessServicesWebServiceApplication"
}

if ($null -eq $serviceApp)
Expand Down Expand Up @@ -91,6 +91,8 @@ function Set-TargetResource
$InstallAccount
)

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

$result = Get-TargetResource @PSBoundParameters

if ($result.Ensure -eq "Absent" -and $Ensure -eq "Present")
Expand Down Expand Up @@ -120,9 +122,19 @@ function Set-TargetResource
$params = $args[0]

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

$proxies = Get-SPServiceApplicationProxy
foreach($proxyInstance in $proxies)
{
if($app.IsConnected($proxyInstance))
{
$proxyInstance.Delete()
}
}
Remove-SPServiceApplication $app -Confirm:$false

Remove-SPServiceApplication -Identity $app -Confirm:$false
}
}
}
Expand Down Expand Up @@ -156,7 +168,9 @@ function Test-TargetResource
)

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

$PSBoundParameters.Ensure = $Ensure

return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("Ensure")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ function Set-TargetResource

)

$CurrentValues = Get-TargetResource @PSBoundParameters
Write-Verbose -Message "Setting Alternate URL for $Zone in $WebAppUrl"

Write-Verbose -Message "Updating app domain settings for $SiteUrl"
$CurrentValues = Get-TargetResource @PSBoundParameters

if ($Ensure -eq "Present")
{
Expand Down Expand Up @@ -168,9 +168,10 @@ function Test-TargetResource

)

Write-Verbose -Message "Testing alternate URL configuration"
Write-Verbose -Message "Testing Alternate URL for $Zone in $WebAppUrl"

$PSBoundParameters.Ensure = $Ensure

if ([string]::IsNullOrEmpty($Url) -and $Ensure -eq "Present")
{
throw "URL must be specified when ensure is set to present"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ function Test-TargetResource
)

Write-Verbose -Message "Testing antivirus configuration settings"

return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
-DesiredValues $PSBoundParameters
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ function Set-TargetResource
$InstallAccount
)

Write-Verbose -Message "Updating app domain settings for $SiteUrl"
Write-Verbose -Message "Setting app catalog status of $SiteUrl"

Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {
Expand All @@ -85,7 +86,8 @@ function Test-TargetResource
$InstallAccount
)

Write-Verbose -Message "Testing app domain settings"
Write-Verbose -Message "Testing app catalog status of $SiteUrl"

return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("SiteUrl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Get-TargetResource
$InstallAccount
)

Write-Verbose -Message "Checking app urls settings"
Write-Verbose -Message "Getting app domain settings"

$result = Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
Expand Down Expand Up @@ -53,7 +53,8 @@ function Set-TargetResource
$InstallAccount
)

Write-Verbose -Message "Updating app domain settings "
Write-Verbose -Message "Setting app domain settings"

Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {
Expand Down Expand Up @@ -83,7 +84,8 @@ function Test-TargetResource
$InstallAccount
)

Write-Verbose -Message "Testing app domain settings"
Write-Verbose -Message "Getting app domain settings"

return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("AppDomain", "Prefix")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function Get-TargetResource
[System.Management.Automation.PSCredential]
$InstallAccount
)

Write-Verbose -Message "Getting App management service app '$Name'"

$result = Invoke-SPDSCCommand -Credential $InstallAccount `
Expand All @@ -53,7 +54,7 @@ function Get-TargetResource
return $nullReturn
}
$serviceApp = $serviceApps | Where-Object -FilterScript {
$_.TypeName -eq "App Management Service Application"
$_.GetType().FullName -eq "Microsoft.SharePoint.AppManagement.AppManagementServiceApplication"
}

if ($null -eq $serviceApp)
Expand Down Expand Up @@ -122,6 +123,8 @@ function Set-TargetResource
$InstallAccount
)

Write-Verbose -Message "Setting App management service app '$Name'"

$result = Get-TargetResource @PSBoundParameters

if ($result.Ensure -eq "Absent" -and $Ensure -eq "Present")
Expand Down Expand Up @@ -177,7 +180,7 @@ function Set-TargetResource
$appPool = Get-SPServiceApplicationPool -Identity $params.ApplicationPool

$app = Get-SPServiceApplication -Name $params.Name | Where-Object -FilterScript {
$_.TypeName -eq "App Management Service Application"
$_.GetType().FullName -eq "Microsoft.SharePoint.AppManagement.AppManagementServiceApplication"
}
$app.ApplicationPool = $appPool
$app.Update()
Expand All @@ -195,9 +198,19 @@ function Set-TargetResource
$params = $args[0]

$app = Get-SPServiceApplication -Name $params.Name | Where-Object -FilterScript {
$_.TypeName -eq "App Management Service Application"
$_.GetType().FullName -eq "Microsoft.SharePoint.AppManagement.AppManagementServiceApplication"
}

$proxies = Get-SPServiceApplicationProxy
foreach($proxyInstance in $proxies)
{
if($app.IsConnected($proxyInstance))
{
$proxyInstance.Delete()
}
}
Remove-SPServiceApplication $app -Confirm:$false

Remove-SPServiceApplication -Identity $app -Confirm:$false
}
}
}
Expand Down Expand Up @@ -237,10 +250,11 @@ function Test-TargetResource
[System.Management.Automation.PSCredential]
$InstallAccount
)
Write-Verbose -Message "Testing for App management Service Application '$Name'"

Write-Verbose -Message "Testing App management service app '$Name'"

$PSBoundParameters.Ensure = $Ensure

return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @("ApplicationPool", "Ensure")
Expand Down
Loading

0 comments on commit c4553e8

Please sign in to comment.