Clear-RecycleBin
Clears the contents of the current user's recycle bin.
구문
All
Clear-RecycleBin
[[-DriveLetter] <String[]>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Clear-RecycleBin
cmdlet deletes the content of the current user's recycle bin. This action is
like using Windows Empty Recycle Bin.
예제
1: Clear all recycle bins
In this example, the current user's recycle bins for all drives are cleared.
Clear-RecycleBin
Confirm
Are you sure you want to perform this action?
Performing the operation "Clear-RecycleBin" on target "All of the contents of the Recycle Bin".
[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.
2: Clear a specified recycle bin
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
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 recycle bins.
Clear-RecycleBin -Force
Clear-RecycleBin
uses the Force parameter and doesn't prompt the user for confirmation to
clear all recycle bins.
An alternative is to replace -Force
with -Confirm:$false
.
매개 변수
-Confirm
Prompts for user confirmation before running the cmdlet. The user is prompted for confirmation even if the Confirm parameter isn't specified.
매개 변수 속성
형식: | SwitchParameter |
Default value: | False |
와일드카드 지원: | False |
DontShow: | False |
별칭: | cf |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-DriveLetter
Specifies the recycle bin to clear for a single drive letter or an array of drive letters.
매개 변수 속성
형식: | String[] |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
(All)
Position: | 0 |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | True |
나머지 인수의 값: | False |
-Force
Specifies that the user isn't prompted for confirmation to clear a recycle bin. The Force parameter also overrides the WhatIf and Confirm parameters.
매개 변수 속성
형식: | SwitchParameter |
Default value: | None |
와일드카드 지원: | False |
DontShow: | False |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
-WhatIf
Shows what would happen if Clear-RecycleBin
runs. The cmdlet isn't run.
매개 변수 속성
형식: | SwitchParameter |
Default value: | False |
와일드카드 지원: | False |
DontShow: | False |
별칭: | wi |
매개 변수 집합
(All)
Position: | Named |
필수: | False |
파이프라인의 값: | False |
속성 이름별 파이프라인의 값: | False |
나머지 인수의 값: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
출력
None
This cmdlet returns no output.