0
我有一个应用程序应该过滤 Processname(这工作正常)和开始时间。通过Starttime PowerShell筛选过程
但我无法通过startfine进行过滤。
我正在尝试下面的代码。谁能帮我?
#Process DropDown Choose
$Choice = $DropDown.SelectedItem.ToString()
#Write-Host $Choice
$MyChoice = $Choice
#Write-Host $MyChoice
$Script:Choice = $DropDown.SelectedItem.ToString()
#Date DropDown Choose
$DtChoice = $DtDropDown.SelectedItem.ToString()
#Write-Host $Choice
$MyDtChoice = $DtChoice
#Write-Host $MyChoice
$Script:DtChoice = $DtDropDown.SelectedItem.ToString()
#Fill Datagrid
$gps = Get-Process | Where-Object {($_.ProcessName -like "$choice") -and ($_.ProcessName -like "$Dtchoice") } |Select-Object id,name,cpu,starttime |Sort-Object -Descending starttime
$list = New-Object System.collections.ArrayList
$list.AddRange($gps)`
$DtDropDown
是这样工作的:
#region Seleção de Data
[array ]$DtConsulta = @(0,0,0,0,0,0,0,0)
$DtDropDown = new-object System.Windows.Forms.ComboBox
$DtDropDown.Location = new-object System.Drawing.Size(60,80)
$DtDropDown.Size = new-object System.Drawing.Size(240,30)
$DtDropDown.DropDownStyle = "DropDownList" # This style of combobox will prevent blank
# item selection.
#Preenchimento da lista de seleção de datas permitidas para busca de historico
ForEach ($i in -7..0)
{
$d = Get-Date
$DtConsulta[$i] = $d.AddDays($i)
$DtDropDown.Items.Add($DtConsulta[$i].ToLongDateString()) | Out-Null
}
我怎样才能通过startfine过滤器?