Share via


Remove-ScannerRepository

Removes a repository from an Microsoft Purview Information Protection scanner content scan job.

Syntax

Default (Default)

Remove-ScannerRepository

    [-Repositories] <System.Collections.Generic.List`1[Microsoft.InformationProtection.Powershell.AIP.Commandlets.Scanner.MoonCake.RepositoryInfo]>
    [-WhatIf]
    [-Confirm]

Description

Deletes any repositories described by the Repositories parameter, or returned by a piped Get-ScannerRepository cmdlet.

For more information about content scan jobs, see the Microsoft Purview Information Protection on-premises scanner documentation.

Examples

Example 1 Remove all repositories configured for your content scan job

PS C:\WINDOWS\system32> Get-ScannerRepository | Remove-ScannerRepository

This example shows a fully piped cmdlet, where the repositories are first returned, and then deleted.

Example 2 Remove a specific repository from your content scan job

PS C:\WINDOWS\system32> Get-ScannerRepository -Path 'c:\repoToScan1' | Remove-ScannerRepository

This example shows a fully piped cmdlet, where the repository is first returned, and then deleted.

Example 3 Remove any repositories that match a specific wildcard pattern from your content scan job

PS C:\WINDOWS\system32> Get-ScannerRepository -Path 'c:\repo*' | Remove-ScannerRepository

This example shows a fully piped cmdlet, where the repositories are first returned, and then deleted.

Example 4 Remove a specific repository from your content scan job without piping

PS C:\WINDOWS\system32> $repos = Get-ScannerRepository -Path 'c:\repoToScan1'
PS C:\WINDOWS\system32> Remove-ScannerRepository $repos

This example shows a fully piped cmdlet, where the repositories are first returned, and then deleted.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Repositories

Describes the repositories you want to delete.

Parameter properties

Type:

System.Collections.Generic.List`1[Microsoft.InformationProtection.Powershell.AIP.Commandlets.Scanner.MoonCake.RepositoryInfo]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

Inputs

System.Collections.Generic.List`1

Outputs

System.Object