Skip to content

Instantly share code, notes, and snippets.

@chrisbaldauf
Last active November 8, 2016 13:01
Show Gist options
  • Save chrisbaldauf/c3f9f84299f095d4ee27 to your computer and use it in GitHub Desktop.
Save chrisbaldauf/c3f9f84299f095d4ee27 to your computer and use it in GitHub Desktop.
cmd vs powershell
net use x: \\server\share /user:domain\username p@$$w0rd
$secpasswd = ConvertTo-SecureString "p@ssw0rd" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("domain\username", $secpasswd)
New-PSDrive -Name "x" -PSProvider FileSystem -Root "\\server\share" -Persist -Credential $mycreds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment