我想使用此脚本删除法语版本的所有内容项目,并将英文版本保留在sitecore中,但想要确保它在排除它之前看起来很好:(
cd 'master:/sitecore/content'
function FilterItemsToProcess($item)
{
Get-Item $item.ProviderPath -Language "fr-CA"
}
$list = [System.Collections.ArrayList]@()
$itemsToProcess = Get-ChildItem -Recurse . | foreach {FilterItemsToProcess($_)}
if($itemsToProcess -ne $null)
{
$itemsToProcess | ForEach-Object {
| remove-item
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用此代码来排序数字基础下降的列表
ItemsList.OrderByDescending(x => x.Views, new IntComparer());
public class IntComparer : IComparer<long>
{
IComparer<long> Members;
public int Compare(long x, long y)
{
return Math.Sign(x - y);
}
}
Run Code Online (Sandbox Code Playgroud)
但它根本没有订购:S任何帮助PLZ