Код: Выделить всё
Get-ChildItem | where {$_.Length -gt 1000000}
Код: Выделить всё
PowerShell ps = PowerShell.Create();
ps.AddCommand("Get-ChildItem");
ps.AddCommand("where-object");
ps.AddParameter("Length");
ps.AddParameter("-gt");
ps.AddParameter("10000");
// Call the PowerShell.Invoke() method to run the
// commands of the pipeline.
foreach (PSObject result in ps.Invoke())
{
Console.WriteLine(
"{0,-24}{1}",
result.Members["Length"].Value,
result.Members["Name"].Value);
} // End foreach.
Подробнее здесь: https://stackoverflow.com/questions/170 ... rows-excep
Мобильная версия