param(        
        $webUrl, # адрес портала
		$pageRelativeUrl, #адрес страницы
		$webPartTitle, #название веб-части
		$propertyName,
		$propertyValue
      )

$snap = Get-PSSnapin | Where-Object { $_.Name -eq "Microsoft.SharePoint.Powershell" }
if ($snap -eq $null)
{
    Add-PSSnapin "Microsoft.SharePoint.Powershell"
}

# -----------------------------------------------
# Подключаем наши библиотеки и модули
# -----------------------------------------------
$execFolder = $(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
. $("$execFolder\WebPartService.ps1")
. $("$execFolder\PageService.ps1")
. $("$execFolder\CommonConstants.ps1")

$web = Get-SPWeb $webUrl;
[Microsoft.SharePoint.SPFile] $sourceFile = $web.GetFile($pageRelativeUrl);
$webPartManager = $sourceFile.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared);
$webPart = GetWebPartByTitle $webPartManager $webPartTitle
$webPart.$propertyName = $propertyValue;
$webPartManager.SaveChanges($webPart)
$web.Dispose > $null
	