Search Results for

    Show / Hide Table of Contents

    Remove-SearchRoot

    Removes the specified search roots from a search catalog.

    Syntax

    Remove-SearchRoot
          [-Path] <String[]>
          [-Catalog <String>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
    

    Description

    The Remove-SearchRoot cmdlet removes the specified search roots from a search catalog.

    Caution

    Removing a search root also removes all search rules associated with it.

    Examples

    Example 1: Remove a search root

    Remove-SearchRoot -Path file:///D:\
    
    Confirm
    Are you sure you want to perform this action?
    Performing the operation "Remove-SearchRoot" on target "SystemIndex Path=file:///D:\".
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
    

    This command removes the search root drive D: from the default Windows Search catalog after prompting the user for confirmation.

    Example 2: Remove a search root without confirmation

    Remove-SearchRoot -Path file:///D:\ -Confirm:$false
    

    This command removes the search root drive D: from the default Windows Search catalog without prompting for confirmation.

    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 root to be removed from a catalog. The specified path must match an existing search root exactly, including the protocol prefix.

    Type

    string[]

    Position

    0

    Default value

    None

    Accept pipeline input

    True (ByPropertyName, ByValue)

    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 roots, see Managing Search Roots in Microsoft's Windows Search documentation.

    Related Links

    • Add-SearchRoot

    • Get-SearchRoot

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