Closed ykuijs closed 2 years ago
The fix for issue #1376 unfortunately introduced a regression issue: https://github.com/dsccommunity/SharePointDsc/blob/df57d18ba35b26017788ab569cece24af4aa57d4/SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/MSFT_SPSearchIndexPartition.psm1#L34-L41
The added Select-Object -First 1 only selected one Index Component. This meant that the Get method only returned one index partition (line 40), instead of only returning a single Root Directory.
Select-Object -First 1
2022-04-22T11:48:41.4910790Z VERBOSE: [SEARCH1]: [[SPSearchIndexPartition]IndexPartition1] Current Values: 2022-04-22T11:48:41.4923044Z Index=1; RootDirectory=L:\SPIndex\1; Servers=SEARCH3; ServiceAppName=Search SA 2022-04-22T11:48:41.4936309Z VERBOSE: [SEARCH1]: [[SPSearchIndexPartition]IndexPartition1] Target Values: Index=1; 2022-04-22T11:48:41.4949400Z RootDirectory=L:\SPIndex\1; Servers=(SEARCH2,SEARCH3); ServiceAppName=Search SA; Verbose=True
Any configuration with two servers running an index component
$searchComponent = Get-SPEnterpriseSearchComponent -SearchTopology $currentTopology -Verbose:$false | ` Where-Object -FilterScript { ($_.GetType().Name -eq "IndexComponent") ` -and ($_.IndexPartitionOrdinal -eq $params.Index) } $IndexComponents = $searchComponent.ServerName $rootDirectory = ($searchComponent | Select-Object -First 1).RootDirectory
Any
v5.1
Problem description
The fix for issue #1376 unfortunately introduced a regression issue: https://github.com/dsccommunity/SharePointDsc/blob/df57d18ba35b26017788ab569cece24af4aa57d4/SharePointDsc/DSCResources/MSFT_SPSearchIndexPartition/MSFT_SPSearchIndexPartition.psm1#L34-L41
The added
Select-Object -First 1
only selected one Index Component. This meant that the Get method only returned one index partition (line 40), instead of only returning a single Root Directory.Verbose logs
DSC configuration
Suggested solution
SharePoint version and build
Operating system the target node is running
PowerShell version and build the target node is running
SharePointDsc version