Skip to content

Commit

Permalink
Merge pull request #1253 from jensotto/fix-error-when-no-workflow-is-…
Browse files Browse the repository at this point in the history
…configured

SPWorkflowService: Fixed error when no workflow service is configured
  • Loading branch information
ykuijs committed Nov 11, 2020
2 parents 59229a7 + 6d5199c commit cadc1e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SPWordAutomationServiceApp
- Fixed issue where provisioning the service app requires a second run to
update all specified parameters
- SPWorkflowService
- Fixed issue configuring workflow service when no workflow service is currently configured.

## [4.3.0] - 2020-09-30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Get-TargetResource

Write-Verbose -Message "Getting the current Workflow Service Configuration(s)"

$result = Invoke-SPDscCommand -Credential $InstallAccount `
$result = Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments $PSBoundParameters `
-ScriptBlock {
$params = $args[0]
Expand All @@ -51,8 +51,15 @@ function Get-TargetResource

if ($null -ne $workflowProxy)
{
$workflowHostUri = $workflowProxy.GetHostname($site)

if ($null -ne $workflowHostUri)
{
$workflowHostUri = $workflowHostUri.TrimEnd("/")
}

$returnval = @{
WorkflowHostUri = $workflowProxy.GetHostname($site).TrimEnd("/")
WorkflowHostUri = $workflowHostUri
SPSiteUrl = $params.SPSiteUrl
ScopeName = $workflowProxy.GetWorkflowScopeName($site)
AllowOAuthHttp = $params.AllowOAuthHttp
Expand Down Expand Up @@ -94,7 +101,7 @@ function Set-TargetResource
Write-Verbose -Message "Registering the Workflow Service"

## Perform changes
Invoke-SPDscCommand -Credential $InstallAccount `
Invoke-SPDSCCommand -Credential $InstallAccount `
-Arguments @($PSBoundParameters, $MyInvocation.MyCommand.Source) `
-ScriptBlock {
$params = $args[0]
Expand Down

0 comments on commit cadc1e4

Please sign in to comment.