Korrektur

This commit is contained in:
Marc Blatter 2025-10-27 10:46:13 +00:00
parent 7825b3f27d
commit 6a8d0fc20e
1 changed files with 4 additions and 7 deletions

View File

@ -6,19 +6,16 @@ $Pass = "RJs6B-JAeRX-wQtiM-Xi4c6-cYBD4"
$SecurePass = ConvertTo-SecureString $Pass -AsPlainText -Force $SecurePass = ConvertTo-SecureString $Pass -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential($User, $SecurePass) $Cred = New-Object System.Management.Automation.PSCredential($User, $SecurePass)
# Prüfen, ob das Laufwerk bereits existiert # Laufwerk X: entfernen, falls vorhanden
if (Get-PSDrive -Name X -ErrorAction SilentlyContinue) { if (Get-PSDrive -Name X -ErrorAction SilentlyContinue) {
Remove-PSDrive -Name X -Force Remove-PSDrive -Name X -Force
} }
# Netzlaufwerk mappen (persistent) über UNC-Pfad für WebDAV # Netzlaufwerk mappen
$UNCPath = "\\cloud.busybox.ch\remote.php\dav\files\$User" $UNCPath = "\\cloud.busybox.ch\remote.php\dav\files\$User"
New-PSDrive -Name X -PSProvider FileSystem -Root $UNCPath -Credential $Cred -Persist New-PSDrive -Name X -PSProvider FileSystem -Root $UNCPath -Credential $Cred -Persist
# Explorer-Laufwerksbezeichnung setzen (Anzeige im Windows Explorer) # Explorer-Laufwerksbezeichnung setzen
# Pfad für MountPoints2 muss genau der UNC-Notation entsprechen
$RegPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##cloud.busybox.ch#remote.php#dav#files#$User" $RegPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##cloud.busybox.ch#remote.php#dav#files#$User"
if (-not (Test-Path $RegPath)) { if (-not (Test-Path $RegPath)) { New-Item -Path $RegPath -Force | Out-Null }
New-Item -Path $RegPath -Force | Out-Null
}
New-ItemProperty -Path $RegPath -Name "_LabelFromReg" -Value "BusyBox" -Force | Out-Null New-ItemProperty -Path $RegPath -Name "_LabelFromReg" -Value "BusyBox" -Force | Out-Null