Skip to content

Mount temporary smb drive

ps1
$NetworkPath = "<SMB>"
$login = ""
$pass = ""

# mount
New-SMBMapping -LocalPath "A:" -RemotePath $NetworkPath -UserName $login -Password $pass


# scripts here

# clean
Remove-SmbMapping -LocalPath "A:" -Force