Skip to content

Commit

Permalink
Cmdlet clears recycle bin for the current user only (#10771)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwheeler authored Jan 5, 2024
1 parent 7ba94fc commit 382c528
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 56 deletions.
26 changes: 12 additions & 14 deletions reference/5.1/Microsoft.PowerShell.Management/Clear-RecycleBin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 01/05/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Clear-RecycleBin
Expand All @@ -11,7 +11,7 @@ title: Clear-RecycleBin
# Clear-RecycleBin

## SYNOPSIS
Clears the contents of a recycle bin.
Clears the contents of the current user's recycle bin.

## SYNTAX

Expand All @@ -23,14 +23,14 @@ Clear-RecycleBin [[-DriveLetter] <String[]>] [-Force] [-WhatIf] [-Confirm] [<Com

## DESCRIPTION

The `Clear-RecycleBin` cmdlet deletes the content of a computer's recycle bin. This action is like
using Windows **Empty Recycle Bin**.
The `Clear-RecycleBin` cmdlet deletes the content of the current user's recycle bin. This action is
like using Windows **Empty Recycle Bin**.

## EXAMPLES

### 1: Clear all recycle bins

In this example, all the local computer's recycle bins are cleared.
In this example, the current user's recycle bins for all drives are cleared.

```powershell
Clear-RecycleBin
Expand All @@ -43,8 +43,7 @@ Performing the operation "Clear-RecycleBin" on target "All of the contents of th
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
```

`Clear-RecycleBin` prompts the user for confirmation to clear all recycle bins on the local
computer.
`Clear-RecycleBin` prompts the user for confirmation.

### 2: Clear a specified recycle bin

Expand All @@ -54,19 +53,19 @@ This example clears the recycle bin for a specified drive letter.
Clear-RecycleBin -DriveLetter C
```

`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the **C**
`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the `C`
volume. The user is prompted for confirmation to run the command.

### 3: Clear all recycle bins without confirmation

This example doesn't prompt for confirmation to clear the local computer's recycle bins.
This example doesn't prompt for confirmation to clear the recycle bins.

```powershell
Clear-RecycleBin -Force
```

`Clear-RecycleBin` uses the **Force** parameter and doesn't prompt the user for confirmation to
clear all recycle bins on the local computer.
clear all recycle bins.

An alternative is to replace `-Force` with `-Confirm:$false`.

Expand Down Expand Up @@ -140,10 +139,9 @@ 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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS
Expand Down
26 changes: 12 additions & 14 deletions reference/7.2/Microsoft.PowerShell.Management/Clear-RecycleBin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 01/05/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Clear-RecycleBin
Expand All @@ -11,7 +11,7 @@ title: Clear-RecycleBin
# Clear-RecycleBin

## SYNOPSIS
Clears the contents of a recycle bin.
Clears the contents of the current user's recycle bin.

## SYNTAX

Expand All @@ -25,16 +25,16 @@ Clear-RecycleBin [[-DriveLetter] <String[]>] [-Force] [-WhatIf] [-Confirm] [<Com

> **This cmdlet is only available on the Windows platform.**
The `Clear-RecycleBin` cmdlet deletes the content of a computer's recycle bin. This action is like
using Windows **Empty Recycle Bin**.
The `Clear-RecycleBin` cmdlet deletes the content of the current user's recycle bin. This action is
like using Windows **Empty Recycle Bin**.

This cmdlet was readded in PowerShell 7.

## EXAMPLES

### 1: Clear all recycle bins

In this example, all the local computer's recycle bins are cleared.
In this example, the current user's recycle bins for all drives are cleared.

```powershell
Clear-RecycleBin
Expand All @@ -47,8 +47,7 @@ Performing the operation "Clear-RecycleBin" on target "All of the contents of th
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
```

`Clear-RecycleBin` prompts the user for confirmation to clear all recycle bins on the local
computer.
`Clear-RecycleBin` prompts the user for confirmation.

### 2: Clear a specified recycle bin

Expand All @@ -58,19 +57,19 @@ This example clears the recycle bin for a specified drive letter.
Clear-RecycleBin -DriveLetter C
```

`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the **C**
`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the `C`
volume. The user is prompted for confirmation to run the command.

### 3: Clear all recycle bins without confirmation

This example doesn't prompt for confirmation to clear the local computer's recycle bins.
This example doesn't prompt for confirmation to clear the recycle bins.

```powershell
Clear-RecycleBin -Force
```

`Clear-RecycleBin` uses the **Force** parameter and doesn't prompt the user for confirmation to
clear all recycle bins on the local computer.
clear all recycle bins.

An alternative is to replace `-Force` with `-Confirm:$false`.

Expand Down Expand Up @@ -144,10 +143,9 @@ 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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS
Expand Down
26 changes: 12 additions & 14 deletions reference/7.3/Microsoft.PowerShell.Management/Clear-RecycleBin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 01/05/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Clear-RecycleBin
Expand All @@ -11,7 +11,7 @@ title: Clear-RecycleBin
# Clear-RecycleBin

## SYNOPSIS
Clears the contents of a recycle bin.
Clears the contents of the current user's recycle bin.

## SYNTAX

Expand All @@ -25,16 +25,16 @@ Clear-RecycleBin [[-DriveLetter] <String[]>] [-Force] [-WhatIf] [-Confirm] [<Com

> **This cmdlet is only available on the Windows platform.**
The `Clear-RecycleBin` cmdlet deletes the content of a computer's recycle bin. This action is like
using Windows **Empty Recycle Bin**.
The `Clear-RecycleBin` cmdlet deletes the content of the current user's recycle bin. This action is
like using Windows **Empty Recycle Bin**.

This cmdlet was readded in PowerShell 7.

## EXAMPLES

### 1: Clear all recycle bins

In this example, all the local computer's recycle bins are cleared.
In this example, the current user's recycle bins for all drives are cleared.

```powershell
Clear-RecycleBin
Expand All @@ -47,8 +47,7 @@ Performing the operation "Clear-RecycleBin" on target "All of the contents of th
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
```

`Clear-RecycleBin` prompts the user for confirmation to clear all recycle bins on the local
computer.
`Clear-RecycleBin` prompts the user for confirmation.

### 2: Clear a specified recycle bin

Expand All @@ -58,19 +57,19 @@ This example clears the recycle bin for a specified drive letter.
Clear-RecycleBin -DriveLetter C
```

`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the **C**
`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the `C`
volume. The user is prompted for confirmation to run the command.

### 3: Clear all recycle bins without confirmation

This example doesn't prompt for confirmation to clear the local computer's recycle bins.
This example doesn't prompt for confirmation to clear the recycle bins.

```powershell
Clear-RecycleBin -Force
```

`Clear-RecycleBin` uses the **Force** parameter and doesn't prompt the user for confirmation to
clear all recycle bins on the local computer.
clear all recycle bins.

An alternative is to replace `-Force` with `-Confirm:$false`.

Expand Down Expand Up @@ -144,10 +143,9 @@ 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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS
Expand Down
26 changes: 12 additions & 14 deletions reference/7.4/Microsoft.PowerShell.Management/Clear-RecycleBin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 01/05/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Clear-RecycleBin
Expand All @@ -11,7 +11,7 @@ title: Clear-RecycleBin
# Clear-RecycleBin

## SYNOPSIS
Clears the contents of a recycle bin.
Clears the contents of the current user's recycle bin.

## SYNTAX

Expand All @@ -25,16 +25,16 @@ Clear-RecycleBin [[-DriveLetter] <String[]>] [-Force] [-WhatIf] [-Confirm] [<Com

> **This cmdlet is only available on the Windows platform.**
The `Clear-RecycleBin` cmdlet deletes the content of a computer's recycle bin. This action is like
using Windows **Empty Recycle Bin**.
The `Clear-RecycleBin` cmdlet deletes the content of the current user's recycle bin. This action is
like using Windows **Empty Recycle Bin**.

This cmdlet was readded in PowerShell 7.

## EXAMPLES

### 1: Clear all recycle bins

In this example, all the local computer's recycle bins are cleared.
In this example, the current user's recycle bins for all drives are cleared.

```powershell
Clear-RecycleBin
Expand All @@ -47,8 +47,7 @@ Performing the operation "Clear-RecycleBin" on target "All of the contents of th
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
```

`Clear-RecycleBin` prompts the user for confirmation to clear all recycle bins on the local
computer.
`Clear-RecycleBin` prompts the user for confirmation.

### 2: Clear a specified recycle bin

Expand All @@ -58,19 +57,19 @@ This example clears the recycle bin for a specified drive letter.
Clear-RecycleBin -DriveLetter C
```

`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the **C**
`Clear-RecycleBin` uses the **DriveLetter** parameter to specify the recycle bin on the `C`
volume. The user is prompted for confirmation to run the command.

### 3: Clear all recycle bins without confirmation

This example doesn't prompt for confirmation to clear the local computer's recycle bins.
This example doesn't prompt for confirmation to clear the recycle bins.

```powershell
Clear-RecycleBin -Force
```

`Clear-RecycleBin` uses the **Force** parameter and doesn't prompt the user for confirmation to
clear all recycle bins on the local computer.
clear all recycle bins.

An alternative is to replace `-Force` with `-Confirm:$false`.

Expand Down Expand Up @@ -144,10 +143,9 @@ 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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS
Expand Down

0 comments on commit 382c528

Please sign in to comment.