<System.Object[]>] [-All] [-CommandType {Alias | Function | Filter | Cmdlet | ExternalScript | Application | Script | Workflow | Configuration | All}] [-FullyQualifiedModule <Microsoft.PowerShell.Commands.ModuleSpecification[]>] [-ListImported] [-Module <System.String[]>] [-ParameterName <...
Get-DynamicDistributionGroup-Identity"Contoso Finance"|Format-ListRecipient*,Included* 使用RecipientFilter 参数的自定义筛选器 如果预装筛选器不能满足你的需求,可以使用RecipientFilter参数创建自定义筛选器。 此参数在以下 cmdlet 上可用: 有关可与RecipientFilter参数一起使用的可筛选属性的详细信息,请参阅RecipientFi...
与管道配合工作的函数与过滤器看起来相似,尽管函数的process块语义等同于过滤器,但是函数在内部以FunctionInfo对象存在;而过滤器以FilterInfo对象存在。下例中的函数会过滤掉管道中所有的奇数,只保留偶数:展开表 PS C:\> function Even-Function>> {>> process>...
2. 如果你想像下面那样列出内容,可以使用Format-List: Dir | Format-List Dir | Format-List Name Dir | Format-List * 1. 2. 3. 递归搜索 注册表提供程序不支持任何过滤器,因此你不能在Dir中使用类似于-filter这样的参数。但是参数-recurse,-include和 -exclude还是支持的。在上一章中,我们使用过它来递归...
$FinalCityList = @($CityList | Where-object -filterScript {$_[2] -like "Chong*"}) 把Where-Object 方法用 @() 进行对象转换即可。 完整的PowerShell脚本为: $CityList = [System.Collections.ArrayList]::new() $CityList.Add(@(“A”,“11”,“Cheng Du”)) | Out-Null $CityList.Add(@(...
Get-WinEvent -FilterHashtable @{LogName='Security';Id=4624} //已成功登录账户 Get-WinEvent -FilterHashtable @{LogName='Security';Id=4634} //已注销账户 Get-EventLog -LogName System -EntryType Error //检测到系统错误 【获取登录信息】
An error occurred while enumerating through a collection: The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.. At xxx + $ListItems = $List.GetItems([Microsoft.SharePoint.Client.CamlQuer ... + ~~...
filterSpecifies a function in which the statement list runs one time for each input object. It has the same effect as a function that contains only a process block.Syntax:Syntax Kopier filter <name> {<statement list>} finallyDefines a statement list that runs after statements that are ...
$Processes = Get-CimInstance -Class win32_process -Filter "name='notepad.exe'" $Processes | Format-Table ProcessName, @{ Label = "Total Running Time" Expression={(Get-Date) - $_.CreationDate} } ProcessName Total Running Time --- --- notepad.exe 03:39:39.6260693 notepad.exe 00:19:56...
$Processes = Get-CimInstance -Class win32_process -Filter "name='notepad.exe'" $Processes | Format-Table ProcessName, @{ Label = "Total Running Time" Expression={(Get-Date) - $_.CreationDate} } ProcessName Total Running Time --- --- notepad.exe 03:39:39.6260693 notepad.exe 00:19:56...