Skip to content

Commit

Permalink
Fixes issue #1195
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Oct 27, 2020
1 parent 673886f commit e9b8836
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- SPConfigWizard
- Fixes issue where a CU installation wasn't registered properly in the
config database. Added logic to run the Product Version timer job
- SPSearchTopology
- Fixes issue where applying a topology failed when the search service
instance was disabled instead of offline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,25 @@ function Set-TargetResource
-ScriptBlock {
$psconfigExe = $args[0]

Write-Verbose -Message "Starting 'Product Version Job' timer job"
$pvTimerJob = Get-SPTimerJob -Identity 'job-admin-product-version'
$lastRunTime = $pvTimerJob.LastRunTime

Start-SPTimerJob -Identity $pvTimerJob

$jobRunning = $true
$maxCount = 30
$count = 0
while ($jobRunning -and $count -le $maxCount)
{
Start-Sleep -Seconds 10

$pvTimerJob = Get-SPTimerJob -Identity 'job-admin-product-version'
$jobRunning = $lastRunTime -eq $pvTimerJob.LastRunTime

$count++
}

$stdOutTempFile = "$env:TEMP\$((New-Guid).Guid)"
$psconfig = Start-Process -FilePath $psconfigExe `
-ArgumentList "-cmd upgrade -inplace b2b -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources -cmd services -install" `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ try
Invoke-Command -ScriptBlock $Global:SPDscHelper.InitializeScript -NoNewScope

# Mocks for all contexts
Mock -CommandName Start-Sleep -MockWith { }
Mock -CommandName Start-SPTimerJob -MockWith { }
Mock -CommandName Get-SPTimerJob -MockWith {
return @{
LastRunTime = Get-Date
}
}

Mock -CommandName Remove-Item -MockWith { }
Mock -CommandName Get-Content -MockWith { return "log info" }
Mock -CommandName Get-SPDscServerPatchStatus -MockWith { return "UpgradeRequired" }
Expand Down

0 comments on commit e9b8836

Please sign in to comment.