Win 11 Map Drive Page

: If it disappears after reboot, open regedit and check: HKEY_CURRENT_USER\Network\Z Should contain ProviderName , UserName , ConnectionType .

try $cred = Import-Clixml -Path "C:\secrets\share_cred.xml" -ErrorAction Stop New-PSDrive -Name $driveLetter[0] -PSProvider FileSystem ` -Root $sharePath -Persist -Credential $cred -ErrorAction Stop Write-Log "Successfully mapped $driveLetter to $sharePath" catch Write-Log "FAILED: $_" exit 1 win 11 map drive

# First time: save credentials $cred = Get-Credential $cred | Export-Clixml -Path "C:\secrets\drive_cred.xml" : If it disappears after reboot, open regedit