title: A parameter cannot be found that matches parameter name 'directory'
body: <p>When I run this code in powershell I get an error that A parameter cannot be found that matches parameter name 'directory'? Any idea what is wrong? Thank you</p>
  
  <pre><code>$Output = @()
  $DirList = GCI \\server\share -directory | %{$_.FullName; GCI $_ -Directory|select -expandproperty FullName}
  ForEach($Dir in $DirList){
      $ACLs=@()
      (get-acl $Dir).accesstostring.split("`n")|?{$_ -match "^(.+?admin(istrators|141))\s+?(\w+?)\s+?(.+)$"}|%{
          $ACLs+=[PSCUSTOMOBJECT]@{Group=$Matches[1];Type=$Matches[2];Access=$Matches[3]}
      }
      ForEach($ACL in $ACLs){
          if($Members){Remove-Variable Members}
          $Members = Get-ADGroupMember $ACL.Group -ErrorAction SilentlyContinue|%{[string]$_.SamAccountName}
          $Output += "$Dir $($ACL.Group) $($ACL.Access) $($Members -join ",")"
      }
  }
  </code></pre>