Fixed new-junction.ps1

This commit is contained in:
Markus Fleschutz
2025-07-24 08:09:48 +02:00
parent 69c488b173
commit 069782beb5

View File

@ -20,10 +20,9 @@ param([string]$junction = "", [string]$targetDir = "")
try {
if ($junction -eq "" ) { $junction = Read-Host "Enter the new junction's path and filename" }
if ($targetDir -eq "" ) { $target = Read-Host "Enter the path to the target directory " }
if ($targetDir -eq "" ) { $targetDir = Read-Host "Enter the path to the target directory " }
New-Item -path "$junction" -itemType Junction -value "$targetDir"
if ($lastExitCode -ne 0) { throw "Command 'New-Item' has failed" }
"✅ New junction '$junction' created, linking to: 📂$targetDir"
exit 0 # success