New-Junction

Creates a new junction.

Syntax

New-Junction [-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.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Link String

The new junction to create

true false
Target String

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

true false

Return Values

System.IO.DirectoryInfo.

EXAMPLE 1

New-Junction -Link 'C:\Windows\system32Link' -Target 'C:\Windows\system32'

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