Share via


Remove-ScannerRepository

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

Syntax

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

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.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Repositories

Describes the repositories you want to delete.

Type:System.Collections.Generic.List`1[Microsoft.InformationProtection.Powershell.AIP.Commandlets.Scanner.MoonCake.RepositoryInfo]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Collections.Generic.List`1[[Microsoft.InformationProtection.Powershell.AIP.Commandlets.Scanner.MoonCake.RepositoryInfo, AIP, Version=2.9.0.0, Culture=neutral, PublicKeyToken=null]]

Outputs

System.Object