Posting a feed to Google Search Appliance (GSA) from PowerShell

PowerShell code to submit a feed to Google Search Appliance:

$dataSource = "MyFeed" # replace this with your datasource name
$gsaUrl = ""; # replace this with your GSA URL

$xml = @"

$dataSource incremental
"@ Write-Output "Submitting feed to $gsaUrl." $body = "feedtype=metadata-and-url&datasource=$dataSource&data=$xml" $contentType = "multipart/form-data" $length = $body.Length Write-Output "Posting feed to GSA:" Write-Output $xml $r=Invoke-WebRequest -uri $gsaUrl -method POST -body $body -ContentType $contentType -UserAgent "Ps-GsaFeedSubmitter"

See also Feeds Protocol Developer’s Guide

Leave a Reply

Your email address will not be published. Required fields are marked *