Search Results for

    Show / Hide Table of Contents

    Remove-SearchRule

    Removes the specified search rules from a search catalog.

    Syntax

    Remove-SearchRule
          [-Path] <String[]>
          [[-RuleSet] <SearchRuleSet>]
          [-Catalog <String>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
    

    Description

    The Remove-SearchRule cmdlet removes the specified search rules from a search catalog.

    Examples

    Example 1: Remove a search rule

    Remove-SearchRule -Path file:///C:\Users\Bob\Documents\FooData\Common\ -RuleSet User
    

    This command removes the specified user rule from the working rule set of the default Windows Search catalog.

    Parameters

    -Catalog

    Specifies the name of the catalog this cmdlet operates on. If omitted, this is the default Windows Search catalog, named SystemIndex.

    Type

    string

    Position

    Named

    Default value

    SystemIndex

    Accept pipeline input

    False

    Accept wildcard characters

    False

    -Path

    Specifies the search rule to be removed from a catalog. The specified path must match an existing search rule exactly, including the protocol prefix.

    Type

    string[]

    Position

    0

    Default value

    None

    Accept pipeline input

    True (ByPropertyName, ByValue)

    Accept wildcard characters

    False

    -RuleSet

    Specifies the rule set the rule belongs to. The acceptable values for this parameter are:

    • User - Removes a user rule from the working rule set. If the user rule is a duplicate of or overrides a default rule, the default rule remains in the working rule set.
    • Default - Removes a default rule from both the working rule set and the default rule set.

    Type

    SearchRuleInfo.SearchRuleSet

    Accepted values

    User, Default

    Position

    1

    Default value

    User

    Accept pipeline input

    True (ByPropertyName)

    Accept wildcard characters

    False

    Inputs

    string[]

    You can pipe paths to this cmdlet.

    Outputs

    None

    This cmdlet returns no output.

    Notes

    To learn more about search rules, see Managing Scope Rules in Microsoft's Windows Search documentation.

    Related Links

    • Add-SearchRule

    • Get-SearchRule

    • Reset-SearchRule

    • Test-SearchRule

    In this article
    Back to top Copyright © 2023 Matthias Wolf, Mawosoft