If-statements checking Present/Absent never becomes true since they are within Invoke-SPDscCommand and using $Ensure istead of $params.Ensure.
Verbose logs
Setting service application publish status '<...>'
Executing as the local run as user <...>
Leaving BeginProcessing Method of Get-SPServiceApplication.
Leaving ProcessRecord Method of Get-SPServiceApplication.
Leaving EndProcessing Method of Get-SPServiceApplication.
in 0.1870 seconds.
DSC configuration
-
Suggested solution
replace:
if ($Ensure -eq "Present")
....
if ($Ensure -eq "Absent")
with:
if ($params.Ensure -eq "Present")
....
if ($params.Ensure -eq "Absent")
SharePoint version and build
SPSE
Operating system the target node is running
-
PowerShell version and build the target node is running
Problem description
If-statements checking Present/Absent never becomes true since they are within Invoke-SPDscCommand and using $Ensure istead of $params.Ensure.
Verbose logs
DSC configuration
Suggested solution
replace:
if ($Ensure -eq "Present") .... if ($Ensure -eq "Absent")
with:
if ($params.Ensure -eq "Present") .... if ($params.Ensure -eq "Absent")
SharePoint version and build
Operating system the target node is running
PowerShell version and build the target node is running
SharePointDsc version