title: Is there a way to map a local drive in powershell when the script is set to "Run As Admin"?
body: <p>This is a portion of my powershell script where I have to map a local folder to the S: Drive. I can't map New-PSDrive when my script 'Run as Admin'. If I do, it is not visible on 'My PC'. I have ran Get-PSDrive and it shows it is visible just not on 'MY PC'. </p>
  
  <p>I have tried Net-Use within PS. 
  I have tried New-SMBmapping</p>
  
  <pre><code>New-SMBmapping -localpath 'S:' -remotepath '\\$comName\pos' -persistent $true
  </code></pre>
  
  <p>My script needs to Run As Admin for the rest of my script.
  Currently this is the my script.</p>
  
  <pre><code>#Get Computer name
  $comName = $computerNameCSV.ComputerName
  
  #This will map folder to S drive
  New-SmbShare -Name "SOP" -Path "C:\FolderShare" -FullAccess Everyone
  New-PSDrive -Name "S" -Root "\\$comName\c$\FolderShare" -Persist -PSProvider "FileSystem"
  </code></pre>