title: Powershell Get-Item cannot find path
body: <p>I am working on a Powershell script to change the ACL of a folder (the $Recycle.Bin folder actually) but I am stuck at actually applying the permission on the folder because the Get-Item cmdlet does not find the path.</p>
  <p>Here's (part of) the script:</p>
  <pre><code>$acl = Get-Acl &quot;$env:USERPROFILE\`$Recycle.Bin&quot;
  $AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(&quot;BUILTIN\Users&quot;,'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow')
  $acl.SetAccessRule($AccessRule)
  (Get-Item &quot;$env:USERPROFILE\`$Recycle.Bin&quot;).SetAccessControl($acl)
  </code></pre>
  <p>The error I am getting is that the path cannot be found:</p>
  <pre><code>Get-Item : Could not find item C:\Users\TestUser\$Recycle.Bin.
  At line:1 char:2
  + (Get-Item &quot;$env:USERPROFILE\`$Recycle.Bin&quot;).SetAccessControl($acl)
  +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (C:\Users\test\$Recycle.Bin:String) [Get-Item], IOException
      + FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.GetItemCommand
  
  You cannot call a method on a null-valued expression.
  At line:1 char:1
  + (Get-Item &quot;$env:USERPROFILE\`$Recycle.Bin&quot;).SetAccessControl($acl)
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
  </code></pre>
  <p>The <code>Get-Item</code> cmdlet cannot find the path but I can succesfully navigate to it using the <code>CD</code> command:</p>
  <pre><code>PS C:\Users\TestUser&gt; cd &quot;$env:USERPROFILE\`$Recycle.Bin&quot;
  PS C:\Users\RestUser\$Recycle.Bin&gt;
  </code></pre>
  <p>I suspect that it's because the $Recycle.Bin folder has a &quot; $ &quot; in the path but then again I believe it shouldn't be interpreted as a variable since I added the &quot; ` &quot; character to it.</p>
  <p>I may be wrong about this though.</p>
  <p>It may be good to point out that this path is actually a User Profile Disk (so a VHDX) that is mounted to the server.</p>
  <p>How can I make it so that the <code>Get-Item</code> cmdlet can actually find the path?</p>
  <p>Thank you!</p>