@JaredBusch said in file sharing in the 21st century:
@black3dynamite said in file sharing in the 21st century:
Its near the bottom of the page that says "Symbolic Link Folder Redirection Script"
Will read that..
My script updated, not tested yet.
$UserName = Read-Host "Enter UserName" $CreateNextCloudFolder = Read-Host "Is this a new Nextcloud user Y/N?" $FolderList = "Desktop,Documents,Downloads,Favorites,Music,Pictures,Videos" $FoldderArray = $FolderList.split(",") ForEach($Folder in $FolderArray) { If($CreateNextCloudFolder -like "y") { New-Item -ItemType Directory -Path "C:\Users\$UserName\Nextcloud\$Folder" -Force } Remove-Item -Path "C:\Users\$UserName\$Folder" -Force -Confirm New-Item -ItemType Junction -Path "C:\Users\$UserName" -Name "$Folder" -Target "C:\Users\$UserName\Nextcloud\$Folder" -Force }
I never thought of using PowerShell native commands to create the Junction point.
I've been using cmd.exe /c mklink /J
within the powershell script to create the them.