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.
|Name||Type||Description||Required?||Pipeline Input||Default Value|
The path to the junction to remove.
Wildcards are supported in Carbon 2.2.0 and later.
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.
|CommonParameters||This cmdlet supports common parameters. For more information type
Remove-Junction -Path 'C:\I\Am\A\Junction'
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.