Warning: Constant USER_COOKIE already defined in /var/www/admin/www/markimarta.ru/wp-config.php on line 85

Warning: Constant PASS_COOKIE already defined in /var/www/admin/www/markimarta.ru/wp-config.php on line 86

Warning: Constant AUTH_COOKIE already defined in /var/www/admin/www/markimarta.ru/wp-config.php on line 87

Warning: Constant SECURE_AUTH_COOKIE already defined in /var/www/admin/www/markimarta.ru/wp-config.php on line 88

Warning: Constant LOGGED_IN_COOKIE already defined in /var/www/admin/www/markimarta.ru/wp-config.php on line 89

Warning: Constant TEST_COOKIE already defined in /var/www/admin/www/markimarta.ru/wp-config.php on line 90
Удаление ContentType с сайта и коллекции сайтов SharePoint из PowerShell « Марк и Марта.Ру. Записки отца-программиста




Удаление ContentType с сайта и коллекции сайтов SharePoint из PowerShell


Warning: Undefined variable $thumbnail in /var/www/admin/www/markimarta.ru/wp-content/themes/markimarta2023/single.php on line 44

Warning: Attempt to read property "ID" on null in /var/www/admin/www/markimarta.ru/wp-content/themes/markimarta2023/single.php on line 44

Warning: Undefined variable $thumbnail in /var/www/admin/www/markimarta.ru/wp-content/themes/markimarta2023/single.php on line 45

Warning: Attempt to read property "post_title" on null in /var/www/admin/www/markimarta.ru/wp-content/themes/markimarta2023/single.php on line 45

Ниже код на PowerShell для удаления ContentType. Это код для удаления ContentType на уровне сайта, для коллекции сайтов нужно заменить $spweb.AvailableContentTypes на (Get-SPSite http://spdev).RootWeb.AvailableContentTypes[$ctypeName].

Удалить ContentType из сайта SharePoint

$spsiteUrl = 'http://spdev'
$ctypeName = 'Content type name' 

$curerntCT = (Get-SPSite $spsiteUrl).RootWeb.AvailableContentTypes[$ctypeName]
$spweb.ContentTypes.Delete($curerntCT.Id) 

 

Удалить ContentType из коллекции сайтов SharePoint

$spwebUrl = 'http://spdev/testsite/'

$ctypeName = 'Content type name' 

$spweb = Get-SPWeb -Identity $spwebUrl 
$curerntCT = $spweb.AvailableContentTypes[$ctypeName] 
$spweb.ContentTypes.Delete($curerntCT.Id)

 


Комментариев нет »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment





Срок проверки reCAPTCHA истек. Перезагрузите страницу.



MarkiMarta.ru. Записки отца-программиста" с 2009 г.
Категория информационной продукции 18+
Яндекс.Метрика