< Back

New-CJunction

Sun Jan 12, 2020 10:45 pm

NAME New-CJunction



SYNOPSIS

Creates a new junction.





SYNTAX

New-CJunction [-Link] <String> [-Target] <String> [<CommonParameters>]





DESCRIPTION

Creates a junction given by `-Link` which points to the path given by `-Target`. If something already exists at

`Link`, an error is written.



Returns a `System.IO.DirectoryInfo` object for the junction, if one is created.





PARAMETERS

-Link <String>

The new junction to create



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Target <String>

The target of the junction, i.e. where the junction will point to



Required? true

Position? 2

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

System.IO.DirectoryInfo.





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



PS C:\\>New-CJunction -Link 'C:\\Windows\\system32Link' -Target 'C:\\Windows\\system32'



Creates the `C:\\Windows\\system32Link` directory, which points to `C:\\Windows\\system32`.











RELATED LINKS

Install-CJunction

Remove-CJunction