I want to set Type="People Search Results" and in Credential Information want to set default authentication using PowerShell. I have used below code to create result source but I am not able to set Type and credential information property using PowerShell.
# create manager instances
$fedManager = New-Object Microsoft.Office.Server.Search.Administration.Query.FederationManager($sspApp)
$searchOwner = Get-SPEnterpriseSearchOwner -Level Ssa
# define query
$queryProperties = New-Object Microsoft.Office.Server.Search.Query.Rules.QueryTransformProperties
# define custom sorting
$sortCollection = New-Object Microsoft.Office.Server.Search.Query.SortCollection
$sortCollection.Add("Title", [Microsoft.Office.Server.Search.Query.SortDirection]::Ascending)
$queryProperties["SortList"] = [Microsoft.Office.Server.Search.Query.SortCollection]$sortCollection
# create result source
$resultSource = $fedManager.GetSourceByName($name,$searchOwner)
Write-Host $resultSources.ResultSource.ToString()
Write-Host $resultSource
if($resultSource)
{
Write-Host "Result Source : $name already exist. Deleting..."
$fedManager.RemoveSource($resultSource)
}
Write-Host "Result Source : $name Creating..."
$resultSource = $fedManager.CreateSource($searchOwner)
$resultSource.Name = $name
$resultSource.ProviderId = $fedManager.ListProviders()[$protocol].Id
$resultSource.CreateQueryTransform($queryProperties, $queryTransform)
$resultSource.Commit()