Skip to content

Commit c4553e8

Browse files
authored
Merge pull request #441 from PowerShell/release-1.4
Release 1.4
2 parents 58559de + 83e1584 commit c4553e8

File tree

193 files changed

+15670
-9580
lines changed

Some content is hidden

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

193 files changed

+15670
-9580
lines changed

.appveyor/appveyor.psm1

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
function Start-AppveyorInstallTask
2+
{
3+
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
4+
Install-Module -Name Pester -Force
5+
Start-Process -Wait -FilePath "git" -ArgumentList @(
6+
"clone",
7+
"-q",
8+
"https://github.com/PowerShell/DscResource.Tests",
9+
(Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
10+
-ChildPath "Modules\SharePointDsc\DscResource.Tests")
11+
)
12+
Start-Process -Wait -FilePath "git" -ArgumentList @(
13+
"clone",
14+
"-q",
15+
"https://github.com/PowerShell/DscResources",
16+
(Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "DscResources")
17+
)
18+
$testHelperPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
19+
-ChildPath "Modules\SharePointDsc\DscResource.Tests\TestHelper.psm1"
20+
Import-Module -Name $testHelperPath -Force
21+
}
22+
23+
function Start-AppveyorTestScriptTask
24+
{
25+
$testResultsFile = ".\TestsResults.xml"
26+
$testHarnessPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
27+
-ChildPath "\Tests\Unit\SharePointDsc.TestHarness.psm1"
28+
$dscTestsPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
29+
-ChildPath "Modules\SharePointDsc\DscResource.Tests"
30+
Import-Module -Name $testHarnessPath
31+
32+
$result = Invoke-SPDscUnitTestSuite -TestResultsFile $testResultsFile `
33+
-DscTestsPath $dscTestsPath
34+
35+
$webClient = New-Object -TypeName "System.Net.WebClient"
36+
37+
$testResultsFilePath = Resolve-Path -Path $testResultsFile
38+
$webClient.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)",
39+
$testResultsFilePath)
40+
41+
if ($result.FailedCount -gt 0)
42+
{
43+
throw "$($result.FailedCount) tests failed."
44+
}
45+
}
46+
47+
function Start-AppveyorAfterTestTask
48+
{
49+
# Move the DSC resource tests folder out so it isn't included in the ZIP module that is made
50+
$dscTestsPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
51+
-ChildPath "Modules\SharePointDsc\DscResource.Tests"
52+
Move-Item -Path $dscTestsPath -Destination $env:APPVEYOR_BUILD_FOLDER
53+
54+
# Import the module again from its new location
55+
$testHelperPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
56+
-ChildPath "DscResource.Tests\TestHelper.psm1"
57+
Import-Module -Name $testHelperPath -Force
58+
59+
$mainModulePath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "modules\SharePointDsc"
60+
61+
# Write the PowerShell help files
62+
$docoPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
63+
-ChildPath "modules\SharePointDsc\en-US"
64+
New-Item -Path $docoPath -ItemType Directory
65+
$docoHelperPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER `
66+
-ChildPath "DscResources\DscResource.DocumentationHelper"
67+
Import-Module -Name $docoHelperPath
68+
Write-DscResourcePowerShellHelp -OutputPath $docoPath -ModulePath $mainModulePath -Verbose
69+
70+
# Import so we can create zip files
71+
Add-Type -assemblyname System.IO.Compression.FileSystem
72+
73+
# Generate the wiki content for the release and zip/publish it to appveyor
74+
$wikiContentPath = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "wikicontent"
75+
New-Item -Path $wikiContentPath -ItemType Directory
76+
Write-DscResourceWikiSite -OutputPath $wikiContentPath -ModulePath $mainModulePath -Verbose
77+
78+
$zipFileName = "SharePointDsc_$($env:APPVEYOR_BUILD_VERSION)_wikicontent.zip"
79+
[System.IO.Compression.ZipFile]::CreateFromDirectory($wikiContentPath,
80+
"$env:APPVEYOR_BUILD_FOLDER\$zipFileName")
81+
Get-ChildItem -Path "$env:APPVEYOR_BUILD_FOLDER\$zipFileName" | ForEach-Object -Process {
82+
Push-AppveyorArtifact $_.FullName -FileName $_.Name
83+
}
84+
85+
# Remove the readme files that are used to generate documentation so they aren't shipped
86+
$readmePaths = "$env:APPVEYOR_BUILD_FOLDER\Modules\**\readme.md"
87+
Get-ChildItem -Path $readmePaths -Recurse | Remove-Item -Confirm:$false
88+
89+
# Add the appropriate build number to the manifest and zip/publish everything to appveyor
90+
$manifest = Join-Path -Path $env:APPVEYOR_BUILD_FOLDER -ChildPath "modules\SharePointDsc\SharePointDsc.psd1"
91+
(Get-Content $manifest -Raw).Replace("1.4.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
92+
$zipFileName = "SharePointDsc_$($env:APPVEYOR_BUILD_VERSION).zip"
93+
[System.IO.Compression.ZipFile]::CreateFromDirectory($mainModulePath, "$env:APPVEYOR_BUILD_FOLDER\$zipFileName")
94+
New-DscChecksum -Path $env:APPVEYOR_BUILD_FOLDER -Outpath $env:APPVEYOR_BUILD_FOLDER
95+
Get-ChildItem -Path "$env:APPVEYOR_BUILD_FOLDER\$zipFileName" | ForEach-Object -Process {
96+
Push-AppveyorArtifact $_.FullName -FileName $_.Name
97+
}
98+
Get-ChildItem -Path "$env:APPVEYOR_BUILD_FOLDER\$zipFileName.checksum" | ForEach-Object -Process {
99+
Push-AppveyorArtifact $_.FullName -FileName $_.Name
100+
}
101+
102+
Set-Location -Path $mainModulePath
103+
$nuspecParams = @{
104+
packageName = "SharePointDsc"
105+
version = $env:APPVEYOR_BUILD_VERSION
106+
author = "Microsoft"
107+
owners = "Microsoft"
108+
licenseUrl = "https://github.com/PowerShell/DscResources/blob/master/LICENSE"
109+
projectUrl = "https://github.com/$($env:APPVEYOR_REPO_NAME)"
110+
packageDescription = "SharePointDsc"
111+
tags = "DesiredStateConfiguration DSC DSCResourceKit"
112+
destinationPath = "."
113+
}
114+
New-Nuspec @nuspecParams
115+
116+
Start-Process -FilePath "nuget" -Wait -ArgumentList @(
117+
"pack",
118+
".\SharePointDsc.nuspec",
119+
"-outputdirectory $env:APPVEYOR_BUILD_FOLDER"
120+
)
121+
$nuGetPackageName = "SharePointDsc." + $env:APPVEYOR_BUILD_VERSION + ".nupkg"
122+
Get-ChildItem "$env:APPVEYOR_BUILD_FOLDER\$nuGetPackageName" | ForEach-Object -Process {
123+
Push-AppveyorArtifact $_.FullName -FileName $_.Name
124+
}
125+
}
126+
127+
Export-ModuleMember -Function *

.github/PULL_REQUEST_TEMPLATE.md

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

1818
**DELETE THIS LINE AND BELOW**

CHANGELOG.md

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

3+
### 1.4
4+
* Set-TargetResource of Service Application now also removes all associated proxies
5+
* Fixed issue with all SPServiceApplication for OS not in En-Us language, add GetType().FullName method in:
6+
- SPAccessServiceApp
7+
- SPAppManagementServiceApp
8+
- SPBCSServiceApp
9+
- SPExcelServiceApp
10+
- SPManagedMetaDataServiceApp
11+
- SPPerformancePointServiceApp
12+
- SPSearchServiceApp
13+
- SPSearchCrawlRule
14+
- SPSecureStoreServiceApp
15+
- SPSubscriptionSettingsServiceApp
16+
- SPUsageApplication
17+
- SPUserProfileServiceApp
18+
- SPVisioServiceApp
19+
- SPWordAutomationServiceApp
20+
- SPWorkManagementServiceApp
21+
* Fixed issue with SPServiceInstance for OS not in En-Us language, add GetType().Name method in:
22+
- SPDistributedCacheService
23+
- SPUserProfileSyncService
24+
* Fixed issue with SPInstallLanguagePack to install before farm creation
25+
* Fixed issue with mounting SPContentDatabase
26+
* Fixed issue with SPShellAdmin and Content Database method
27+
* Fixed issue with SPServiceInstance (Set-TargetResource) for OS not in En-Us language
28+
* Added .Net 4.6 support check to SPInstall and SPInstallPrereqs
29+
* Improved code styling
30+
* SPVisioServiceapplication now creates proxy and lets you specify a name for it
31+
* New resources: SPAppStoreSettings
32+
* Fixed bug with SPInstallPrereqs to allow minor version changes to prereqs for SP2016
33+
* Refactored unit tests to consolidate and streamline test approaches
34+
* Updated SPExcelServiceApp resource to add support for trusted file locations and most other properties of the service app
35+
* Added support to SPMetadataServiceApp to allow changing content type hub URL on existing service apps
36+
* Fixed a bug that would cause SPSearchResultSource to throw exceptions when the enterprise search centre URL has not been set
37+
* Updated documentation of SPProductUpdate to reflect the required install order of product updates
38+
339
### 1.3
440
* Fixed typo on return value in SPServiceAppProxyGroup
541
* Fixed SPJoinFarm to not write output during successful farm join

Modules/SharePointDsc/DSCResources/MSFT_SPAccessServiceApp/MSFT_SPAccessServiceApp.psm1

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Get-TargetResource
4545
return $nullReturn
4646
}
4747
$serviceApp = $serviceApps | Where-Object -FilterScript {
48-
$_.TypeName -eq "Access Services Web Service Application"
48+
$_.GetType().FullName -eq "Microsoft.Office.Access.Services.MossHost.AccessServicesWebServiceApplication"
4949
}
5050

5151
if ($null -eq $serviceApp)
@@ -91,6 +91,8 @@ function Set-TargetResource
9191
$InstallAccount
9292
)
9393

94+
Write-Verbose -Message "Setting Access Services service app '$Name'"
95+
9496
$result = Get-TargetResource @PSBoundParameters
9597

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

122124
$app = Get-SPServiceApplication -Name $params.Name | Where-Object -FilterScript {
123-
$_.TypeName -eq "Access Services Web Service Application"
125+
$_.GetType().FullName -eq "Microsoft.Office.Access.Services.MossHost.AccessServicesWebServiceApplication"
126+
}
127+
128+
$proxies = Get-SPServiceApplicationProxy
129+
foreach($proxyInstance in $proxies)
130+
{
131+
if($app.IsConnected($proxyInstance))
132+
{
133+
$proxyInstance.Delete()
134+
}
124135
}
125-
Remove-SPServiceApplication $app -Confirm:$false
136+
137+
Remove-SPServiceApplication -Identity $app -Confirm:$false
126138
}
127139
}
128140
}
@@ -156,7 +168,9 @@ function Test-TargetResource
156168
)
157169

158170
Write-Verbose -Message "Testing for Access Service Application '$Name'"
171+
159172
$PSBoundParameters.Ensure = $Ensure
173+
160174
return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
161175
-DesiredValues $PSBoundParameters `
162176
-ValuesToCheck @("Ensure")

Modules/SharePointDsc/DSCResources/MSFT_SPAlternateUrl/MSFT_SPAlternateUrl.psm1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ function Set-TargetResource
9696

9797
)
9898

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

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

103103
if ($Ensure -eq "Present")
104104
{
@@ -168,9 +168,10 @@ function Test-TargetResource
168168

169169
)
170170

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

173173
$PSBoundParameters.Ensure = $Ensure
174+
174175
if ([string]::IsNullOrEmpty($Url) -and $Ensure -eq "Present")
175176
{
176177
throw "URL must be specified when ensure is set to present"

Modules/SharePointDsc/DSCResources/MSFT_SPAntivirusSettings/MSFT_SPAntivirusSettings.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ function Test-TargetResource
198198
)
199199

200200
Write-Verbose -Message "Testing antivirus configuration settings"
201+
201202
return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
202203
-DesiredValues $PSBoundParameters
203204
}

Modules/SharePointDsc/DSCResources/MSFT_SPAppCatalog/MSFT_SPAppCatalog.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ function Set-TargetResource
6161
$InstallAccount
6262
)
6363

64-
Write-Verbose -Message "Updating app domain settings for $SiteUrl"
64+
Write-Verbose -Message "Setting app catalog status of $SiteUrl"
65+
6566
Invoke-SPDSCCommand -Credential $InstallAccount `
6667
-Arguments $PSBoundParameters `
6768
-ScriptBlock {
@@ -85,7 +86,8 @@ function Test-TargetResource
8586
$InstallAccount
8687
)
8788

88-
Write-Verbose -Message "Testing app domain settings"
89+
Write-Verbose -Message "Testing app catalog status of $SiteUrl"
90+
8991
return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
9092
-DesiredValues $PSBoundParameters `
9193
-ValuesToCheck @("SiteUrl")

Modules/SharePointDsc/DSCResources/MSFT_SPAppDomain/MSFT_SPAppDomain.psm1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function Get-TargetResource
1717
$InstallAccount
1818
)
1919

20-
Write-Verbose -Message "Checking app urls settings"
20+
Write-Verbose -Message "Getting app domain settings"
2121

2222
$result = Invoke-SPDSCCommand -Credential $InstallAccount `
2323
-Arguments $PSBoundParameters `
@@ -53,7 +53,8 @@ function Set-TargetResource
5353
$InstallAccount
5454
)
5555

56-
Write-Verbose -Message "Updating app domain settings "
56+
Write-Verbose -Message "Setting app domain settings"
57+
5758
Invoke-SPDSCCommand -Credential $InstallAccount `
5859
-Arguments $PSBoundParameters `
5960
-ScriptBlock {
@@ -83,7 +84,8 @@ function Test-TargetResource
8384
$InstallAccount
8485
)
8586

86-
Write-Verbose -Message "Testing app domain settings"
87+
Write-Verbose -Message "Getting app domain settings"
88+
8789
return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
8890
-DesiredValues $PSBoundParameters `
8991
-ValuesToCheck @("AppDomain", "Prefix")

Modules/SharePointDsc/DSCResources/MSFT_SPAppManagementServiceApp/MSFT_SPAppManagementServiceApp.psm1

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function Get-TargetResource
3333
[System.Management.Automation.PSCredential]
3434
$InstallAccount
3535
)
36+
3637
Write-Verbose -Message "Getting App management service app '$Name'"
3738

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

5960
if ($null -eq $serviceApp)
@@ -122,6 +123,8 @@ function Set-TargetResource
122123
$InstallAccount
123124
)
124125

126+
Write-Verbose -Message "Setting App management service app '$Name'"
127+
125128
$result = Get-TargetResource @PSBoundParameters
126129

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

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

197200
$app = Get-SPServiceApplication -Name $params.Name | Where-Object -FilterScript {
198-
$_.TypeName -eq "App Management Service Application"
201+
$_.GetType().FullName -eq "Microsoft.SharePoint.AppManagement.AppManagementServiceApplication"
202+
}
203+
204+
$proxies = Get-SPServiceApplicationProxy
205+
foreach($proxyInstance in $proxies)
206+
{
207+
if($app.IsConnected($proxyInstance))
208+
{
209+
$proxyInstance.Delete()
210+
}
199211
}
200-
Remove-SPServiceApplication $app -Confirm:$false
212+
213+
Remove-SPServiceApplication -Identity $app -Confirm:$false
201214
}
202215
}
203216
}
@@ -237,10 +250,11 @@ function Test-TargetResource
237250
[System.Management.Automation.PSCredential]
238251
$InstallAccount
239252
)
240-
241-
Write-Verbose -Message "Testing for App management Service Application '$Name'"
253+
254+
Write-Verbose -Message "Testing App management service app '$Name'"
242255

243256
$PSBoundParameters.Ensure = $Ensure
257+
244258
return Test-SPDscParameterState -CurrentValues (Get-TargetResource @PSBoundParameters) `
245259
-DesiredValues $PSBoundParameters `
246260
-ValuesToCheck @("ApplicationPool", "Ensure")

0 commit comments

Comments
 (0)