존재하지 않는 $item.RichTextMode = "FullHtml"
RichTextMode
로
try
{
$ctx=New-Object Microsoft.SharePoint.Client.ClientContext($Url)
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Username, $password)
$ctx.Load($ctx.Web)
$ctx.ExecuteQuery()
$ll=$ctx.Web.Lists.GetByTitle($ListTitle)
$ctx.Load($ll)
$ctx.ExecuteQuery()
#Add new field to the list
Write-Host "`nGot List" $ListTitle
$fieldColl = $ll.Fields;
$isDescriptionPlainText = $false;
$ctx.Load($fieldColl);
$ctx.ExecuteQuery();
foreach ($item in $fieldColl)
{
if($item.InternalName -eq "VisualDescription")
{
if($item.InternalName -eq "VisualDescription" -and $item.RichText -eq $false)
{
Write-Host ("`n'{0}' Field available.Making Rich Text"-f $item.InternalName)
$msg=("`n'{0}' Field available.Making Rich Text"-f $item.InternalName)
writeToLog $msg
$isDescriptionPlainText=$true;
$item.RichText = $true
$item.update()
}
else
{
Write-Host ("`n Field not available or already a rich text.")
$msg=("Field not available or already a rich text.")
writeToLog $msg
}
}
}
if($isDescriptionPlainText)
{
$ll.update()
$ctx.Load($ll)
$ctx.ExecuteQuery()
}
}
catch
{
$errorMessage = $_.Exception.Message
$errLineNumber = $_.InvocationInfo.ScriptLineNumber
$errOffset = $_.InvocationInfo.OffsetInLine
$msg = "The script failed due to an unexpected error. [Reason]: $errorMessage [Error Line Number]: $errLineNumber ($errOffset)"
writeErrorToLog $msg
# Log the entire stack trace
writeErrorToLog $_.Exception
Write-Error $msg
}
내가 사용할 수 없습니다 PowerShell을 사용합니다.
우리는 지금까지 시도 어떤 코드를 제공하십시오 필드의 SchemaXML의 속성을 변경하고 FullHtml
$item.SchemaXml=$item.SchemaXml.Replace("RichTextMode=`"Compatible`"","RichTextMode=`"FullHtml`"")
에
Compatible
에서RichTextMode
를 교체해야합니다. – JustBaron지금까지 시도한 코드가 추가되었습니다. – SudarshanJ