< Back

Remove-CJunction

Sun Jan 12, 2020 10:55 pm

NAME Remove-CJunction



SYNOPSIS

Removes a junction.





SYNTAX

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



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





DESCRIPTION

`Remove-CJunction` 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.





PARAMETERS

-Path <String>

The path to the junction to remove.



Wildcards are supported in Carbon 2.2.0 and later.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? 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.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Remove-CJunction -Path 'C:\\I\\Am\\A\\Junction'



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









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Remove-CJunction -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.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Remove-CJunction -LiteralPath 'C:\\Temp\\ContainsWildcards[]'



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











RELATED LINKS

Install-CJunction

New-CJunction

Test-CPathIsJunction

Uninstall-CJunction