Skip to content

Commit

Permalink
Merge pull request #52 from dsccommunity/dev
Browse files Browse the repository at this point in the history
Merge of dev with master
  • Loading branch information
ykuijs authored Apr 2, 2020
2 parents 8bea309 + 07c3885 commit 370d995
Show file tree
Hide file tree
Showing 32 changed files with 4,588 additions and 966 deletions.
6 changes: 5 additions & 1 deletion .MetaTestOptIn.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
"Common Tests - Validate Markdown Files",
"Common Tests - Validate Example Files"
"Common Tests - Validate Example Files",
"Common Tests - Validate Module Files",
"Common Tests - Validate Script Files",
"Common Tests - Relative Path Length",
"Common Tests - Validate Markdown Links"
]
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
"powershell.scriptAnalysis.enable": true,
"powershell.scriptAnalysis.settingsPath": ".vscode/ScriptAnalyzerSettings.psd1",
"powershell.codeFormatting.autoCorrectAliases": true,
"powershell.codeFormatting.useCorrectCasing": true,
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": false,
"powershell.codeFormatting.newLineAfterCloseBrace": true,
Expand All @@ -10,7 +12,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 +25,4 @@
"node_modules": true,
"markdownissues.txt": true
}
}
}
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,35 @@

## Unreleased

* OfficeOnlineServerDsc
* Optin to the following Dsc Resource metatests:
* Common Tests - Validate Module Files
* Common Tests - Validate Script Files
* Common Tests - Relative Path Length
* Common Tests - Validate Markdown Links
* OfficeOnlineServerFarm
* Added logic to make sure this resource does not interfere with
a patch installation after a reboot
* OfficeOnlineServerInstall
* Updated error code checks to force reboot
* Added check for CDROM to prevent issues with block file check
* OfficeOnlineServerInstallLanguagePack
* Added Contextual Help information
* Added check for CDROM to prevent issues with block file check
* OfficeOnlineServerMachine
* Added logic to make sure this resource does not interfere with
a patch installation after a reboot
* Removed check for MachineToJoin. The resource only needs to check
for farm join, especially with the new ProductUpdate resource.
* OfficeOnlineServerProductUpdate
* New resource

## 1.4.0.0

* OfficeOnlineServerInstall
* Updated resource to make sure the Windows Environment
variables are loaded into the PowerShell session;
* Updated error code checks to force reboot;
* OfficeOnlineServerMachine
* Updated resource to make sure the Windows Environment
variables are loaded into the PowerShell session;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$script:OOSDscRegKey = "HKLM:\SOFTWARE\OOSDsc"

$script:v16onlyParams = @("AllowOutboundHttp", "S2SCertificateName", "OnlinePictureEnabled", `
"OnlineVideoEnabled", "OfficeAddinEnabled", `
"ExcelUseEffectiveUserName", "ExcelUdfsAllowed", `
Expand All @@ -12,7 +14,7 @@ function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
Param
(
[Parameter()]
[System.Boolean]
Expand Down Expand Up @@ -290,7 +292,7 @@ function Get-TargetResource
function Set-TargetResource
{
[CmdletBinding()]
param
Param
(
[Parameter()]
[System.Boolean]
Expand Down Expand Up @@ -508,15 +510,15 @@ function Set-TargetResource
Write-Verbose -Message $_
}

if(-not $officeWebAppsFarm)
if (-not $officeWebAppsFarm)
{
Write-Verbose "Installing new WebAppsFarm"
New-OfficeWebAppsFarm @PSBoundParameters -Force
$null = New-OfficeWebAppsFarm @PSBoundParameters -Force
}
else
{
Write-Verbose "WebAppsFarm found setting parameters on farm"
Set-OfficeWebAppsFarm @PSBoundParameters -Force
$null = Set-OfficeWebAppsFarm @PSBoundParameters -Force
}
}

Expand All @@ -525,7 +527,7 @@ function Test-TargetResource
{
[CmdletBinding()]
[OutputType([System.Boolean])]
param
Param
(
[Parameter()]
[System.Boolean]
Expand Down Expand Up @@ -732,6 +734,20 @@ function Test-TargetResource

Confirm-OosDscEnvironmentVariables

# Check if server is continuing after a patch install reboot
if (Test-Path -Path $OOSDscRegKey)
{
$key = Get-Item -Path $OOSDscRegKey
$state = $key.GetValue("State")

if ($state -eq "Patching")
{
Write-Verbose -Message "Server continuing after a patch reboot. Farm creation not required."
Write-Verbose -Message "Returning True to prevent issues."
return $true
}
}

Test-OosDscV16Support -Parameters $PSBoundParameters

try
Expand All @@ -744,7 +760,7 @@ function Test-TargetResource
return $false
}

if($PSBoundParameters.ContainsKey('FarmOU'))
if ($PSBoundParameters.ContainsKey('FarmOU'))
{
if ((Test-OosDscFarmOu -ExistingOU $officeWebAppsFarm.FarmOU -DesiredOU $FarmOU) -ne $true)
{
Expand All @@ -755,7 +771,10 @@ function Test-TargetResource
}
}

$currentValues = Get-TargetResource @PSBoundParameters
$CurrentValues = Get-TargetResource @PSBoundParameters

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

if ($InternalURL.EndsWith('/') -eq $false)
{
Expand All @@ -769,7 +788,7 @@ function Test-TargetResource
{
$Proxy += "/"
}
return Test-OosDscParameterState -CurrentValues $currentValues `
return Test-OosDscParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck @(
"InternalURL",
Expand Down Expand Up @@ -828,17 +847,19 @@ function Test-OosDscV16Support
{
[CmdletBinding()]
[OutputType([System.Boolean])]
param(
Param
(
[Parameter(Mandatory=$true)]
[Object]
$Parameters
)

$version = Get-OosDscInstalledProductVersion
switch ($version.Major) {
switch ($version.Major)
{
15 {
Write-Verbose -Message "Office Web Apps 2013 install detected. Checking parameter use."
foreach($param in $script:v16onlyParams)
foreach ($param in $script:v16onlyParams)
{
if ($Parameters.ContainsKey($param) -eq $true)
{
Expand Down
Loading

0 comments on commit 370d995

Please sign in to comment.