title: Powershell Mount Point Automation: Drive letter appears after reboot
body: <p>I've got a strange behavior with powershell created moint points:</p>
  
  <p>My script creates partitions and mounts them into the file system. After a reboot every partition has a drive letter added.</p>
  
  <p>My script so far:</p>
  
  <pre><code>  $disks = Get-Disk|where {$_.Number -ge 5}  ## &gt;= 5: index disks
    $counter = 1
    foreach( $disk in $disks){
      $diskName="Disk_"+$counter.ToString("00")
      $disk = $disk | initialize-Disk -PartitionStyle GPT -passthru|new-partition -UseMaximumSize
      Format-Volume -Partition $disk -FileSystem ReFS -NewFileSystemLabel $diskName -Confirm:$false
      New-Item -ItemType Directory -Path ( "f:\Mounts\"+$diskName )
      $disk | Add-PartitionAccessPath -AccessPath ( "f:\Mounts\"+$diskName )
    }
  </code></pre>
  
  <p>At first I created the mount point disk as ReFS. This worked well, but the drive letter also appeared after a reboot. Also the mount point wasn't shown in the disk management MMC after the reboot.
  Using NTFS fixed the last issue, but the drive letter stil reappears when using the above script.</p>
  
  <p>If I delete the driver letter by hand it doesn't come back.</p>
  
  <p>The system is a Server 2012 R2 </p>
  
  <p>Any ideas?</p>