Skip to content

Build-LMFilter

Syntax

Terminal window
Build-LMFilter [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Description

The Build-LMFilter function creates a filter expression by interactively prompting for conditions and operators. It supports basic filtering for single fields and advanced filtering for property-based queries. Multiple conditions can be combined using AND/OR operators.

Examples

Example 1

Terminal window
#Build a basic filter expression
Build-LMFilter
This example launches the interactive filter builder wizard.

Example 2

Terminal window
#Build a filter and return the expression
Build-LMFilter -PassThru
This example builds a filter and returns the expression as a string.

Parameters

-PassThru

When specified, returns the filter expression as a string instead of displaying it in a panel.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None. You cannot pipe objects to this command.

Outputs

[String] Returns a PowerShell filter expression when using -PassThru.

Notes

The filter expression is saved to the global $LMFilter variable.