Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1585

Other Software & Customization • Re: Link Shell Extension, Hard and Symbolic Links

$
0
0
Ok, so where you've changed the whole thing, I've gotten lost on what's what, sorry!
  • $path = "C:\Path\To\Junctions" - Understand this...
  • $junctions = @("C:\Target\Folder1", "C:\Target\Folder2") - I get this, but aren't I having to specify the entire path for each Junction and Target? Is the C: part necessary here? I was assuming something like:
    $junctions = @("$path\Target\Folder1", "$path\Target\Folder2")
  • $junctionPath = "$path\$([System.IO.Path]::GetFileName($junction))" - This basically puts the $path variable in the actual Junction path. I was looking to add the $path variable to the Target path.
As the Junctions will be placed within non-changing system folders, the need for a variable when specifying path isn't necessary, it doesn't change.
The idea was to have a single place to change the path to the Target directories. Should I decide to move them, I can just change one line.

Also, having each junction on a separate line is much easier to read and edit, as it was before, can it be done that way instead please. :rosegift:
Having a single line for a hundred Junctions makes my eyes go fuzzy! O.O

Can I just combine them to do this:

Code:

$path = "D:\Path\To\Target"$junctions = @{   "C:\Path\To\Junction1" = "$path\Target\Folder1"   "C:\Path\To\Junction2" = "$path\Target\Folder2"}foreach ($junction in $junctions.GetEnumerator()) {    New-Item -ItemType Junction -Path "$($junction.Key)" -Target "$($junction.Value)"}
But do the double quotes around both the $path variable and the Target cause a conflict?

Statistics: Posted by sl23 — Today, 9:52 am



Viewing all articles
Browse latest Browse all 1585

Trending Articles