Remove-BuildItem

September 18, 2025 ยท View on GitHub

(remove) Removes specified items.

Syntax

Remove-BuildItem [-Path] String[]

Description

Scripts use its alias 'remove'. This command removes existing items,
ignores missing items, and fails if it cannot remove existing items.

Use the switch Verbose in order to output messages about removing
existing and skipping missing items or patterns specified by Path.

Parameters

-Path
    Specifies the items to be removed. Wildcards are allowed.
    The parameter is mostly the same as Path of Remove-Item.
    For sanity, paths with only ., *, \, / are not allowed.
    
    Required?                    true
    Position?                    0
    Accept wildcard characters?  true

Examples

-------------------------- EXAMPLE 1 --------------------------
# Remove some temporary items

remove bin, obj, *.test.log