Removes a junction.


Remove-Junction [-Path] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

Remove-Junction -LiteralPath <String> [-WhatIf] [-Confirm] [<CommonParameters>]


Remove-Junction removes an existing junction.

In Carbon 2.1.1 and earlier, the Path paramater does not support wildcard characters, nor can it delete junctions that contained wildcards.

Carbon 2.2.0 added support for wildcards in the Path parameter. If using wildcards, if the wildcard pattern doesn't match any junctions, nothing is removed and you'll get no errors. If the Path parameter does not contain wildcards, Path must exist and must be a path to a junction.

Carbon 2.2.0 also added the LiteralPath parameter. Use it to delete junctions whose path contains wildcard characters.

Related Commands


Name Type Description Required? Pipeline Input Default Value
Path String

The path to the junction to remove.

Wildcards are supported in Carbon 2.2.0 and later.

true false
LiteralPath String

The literal path to the junction to remove. Use this parameter to remove junctions whose paths contain wildcard characters.

This parameter was added in Carbon 2.2.0.

true false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.


Remove-Junction -Path 'C:\I\Am\A\Junction'

Removes the C:\I\Am\A\Junction path.


Remove-Junction -path 'C:\Temp\*'

Demonstrates how to use wildcards to delete multiple junctions in a directory. Nothing happens if the wildcard doesn't match any junctions.


Remove-Junction -LiteralPath 'C:\Temp\ContainsWildcards[]'

Demonstrates how to use the Literalpath parameter to delete a junction that contains wildcard characters.