Powershell-GUI过滤器列表

时间:2015-01-25 12:43:42

标签: powershell

我尝试使用Powershell-GUI构建搜索列表表单。

$searchButton = GenerateButton -text 'search' -x 10 -y 280 -action {
    $data = $listForm.Items  -like "*$searchInput.Text*"
    $listForm.DataSource = $data
}

过滤器-like不适用于对象。

1 个答案:

答案 0 :(得分:0)

如果要将某些内容与Text $searchInput属性的值进行比较,则必须在字符串中使用子表达式:

$data = $listForm.Items  -like "*$($searchInput.Text)*"
相关问题