Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 2.0 » Clear-Item

Clear-Item - Powershell 2.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

Clear-Item

Short description
Deletes the contents of an item, but does not delete the item.

Syntax
Clear-Item [-LiteralPath] <string[]> [-Credential <PSCredential>] [-Exclude <string[]>] [-Filter <string>] [-Force]
     [-Include <string[]>] [-Confirm] [-WhatIf] [-UseTransaction] [<CommonParameters>]
    
    Clear-Item [-Path] <string[]> [-Credential <PSCredential>] [-Exclude <string[]>] [-Filter <string>] [-Force] [-Incl
    ude <string[]>] [-Confirm] [-WhatIf] [-UseTransaction] [<CommonParameters>]

Description
The Clear-Item cmdlet deletes the value of an item, but it does not delete the item. For example, Clear-Item can delete the value of a variable, but it does not delete the variable. The value that used to represent a cleared item is defined by each Windows PowerShell provider.  Clear-Item is similar to Clear-Content, but it works on aliases and variables, instead of files.