Skip to content

Instantly share code, notes, and snippets.

@danielmorell
Created January 3, 2020 22:30
Show Gist options
  • Save danielmorell/d3f45a5c96fef9c770f4c408fc6fd423 to your computer and use it in GitHub Desktop.
Save danielmorell/d3f45a5c96fef9c770f4c408fc6fd423 to your computer and use it in GitHub Desktop.
>_ PowerShell Magic

>_ PowerShell Magic

These are some magical tips and scripts for PowerShell that I want to keep track of.

  1. Symbolic Links

Symbolic Links

Hard Symbolic Links

To create a hard symbolic link with PowerShell you will need to specify the -ItemType as Junction for directories or HardLink for files.

Create Directory Link

$ New-Item -ItemType Junction -Path "Link" -Target "Target"

Create File Link

$ New-Item -ItemType HardLink -Path "Link" -Target "Target"

Soft Symbolic Links

This works for both files and directories.

$ New-Item -ItemType SymbolicLink -Path "Link" -Target "Target"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment