小编Mir*_*ypt的帖子

powershell脚本删除sitecore中法语版的所有内容项

我想使用此脚本删除法语版本的所有内容项目,并将英文版本保留在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)

powershell sitecore

5
推荐指数
1
解决办法
2743
查看次数

数字基础上的订单列表<T>

我正在使用此代码来排序数字基础下降的列表

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

c# generics sql-order-by icomparer icomparablet

0
推荐指数
1
解决办法
409
查看次数