From 0550fd0e0edf68bde3b4a27fdf647274fbf37c59 Mon Sep 17 00:00:00 2001 From: Jens Otto Hatlevold Date: Tue, 17 Nov 2020 13:53:56 +0100 Subject: [PATCH] Fixed incorrect parameter usage --- CHANGELOG.md | 6 ++++++ .../MSFT_SPWebAppPolicy/MSFT_SPWebAppPolicy.psm1 | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b29e663b..d373905b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- SPWebAppPolicy + - Fixed a blocking issue introduced in version 4.4.0 when extracting cache + accounts + ## [4.4.0] - 2020-11-14 ### Added diff --git a/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/MSFT_SPWebAppPolicy.psm1 b/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/MSFT_SPWebAppPolicy.psm1 index 977801b2d..4d9d1d838 100644 --- a/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/MSFT_SPWebAppPolicy.psm1 +++ b/SharePointDsc/DSCResources/MSFT_SPWebAppPolicy/MSFT_SPWebAppPolicy.psm1 @@ -294,7 +294,7 @@ function Set-TargetResource throw $message } - $cacheAccounts = Get-SPDscCacheAccountConfiguration -InputParameters $WebAppUrl + $cacheAccounts = Get-SPDscCacheAccountConfiguration -WebApplicationUrl $WebAppUrl if ($SetCacheAccountsPolicy) { @@ -692,7 +692,7 @@ function Test-TargetResource return $false } - $cacheAccounts = Get-SPDscCacheAccountConfiguration -InputParameters $WebAppUrl + $cacheAccounts = Get-SPDscCacheAccountConfiguration -WebApplicationUrl $WebAppUrl if ($SetCacheAccountsPolicy) { if (($cacheAccounts.SuperUserAccount -eq "") -or ` @@ -944,18 +944,18 @@ function Get-SPDscCacheAccountConfiguration() [OutputType([System.Collections.Hashtable])] param ( [Parameter()] - [Object[]] - $InputParameters + [string] + $WebApplicationUrl ) $cacheAccounts = Invoke-SPDscCommand -Credential $InstallAccount ` - -Arguments @($InputParameters, $MyInvocation.MyCommand.Source) ` + -Arguments @($WebApplicationUrl, $MyInvocation.MyCommand.Source) ` -ScriptBlock { Write-Verbose -Message "Retrieving CacheAccounts" - $params = $args[0] + $webApplicationUrl = $args[0] $eventSource = $args[1] - $wa = Get-SPWebApplication -Identity $params -ErrorAction SilentlyContinue + $wa = Get-SPWebApplication -Identity $webApplicationUrl -ErrorAction SilentlyContinue if ($null -eq $wa) {