title: Export Folder Permissions
body: <p>I want to Export folder Permissions for a subset of folders. 
  Each Folder in <code>Department</code> has two child's, <code>Public</code> and <code>Internal</code>.</p>
  
  <p>For example, I want the permissions of the folder <code>D:\Data\Department\Science\Public</code> or <code>D:\Data\Department\Sales\Public</code>.</p>
  
  <pre><code>$FolderPath = dir -Directory -Path "D:\Data\Department" -Force
  $Report = @()
  Foreach ($Folder in $FolderPath) 
  {
  $Folder2 = Join-Path -Path $Folder -ChildPath "Public"
  
  $Acl = Get-Acl $Folder2.FullName
  
  foreach ($Access in $acl.Access)
  {
  $Properties = [ordered]@{'FolderName'=$Folder2.FullName;'AD
  Group or User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}
  $Report += New-Object -TypeName PSObject -Property $Properties
  }
  }
  $Report | Export-Csv -path "C:\Users\adminrw\FolderPermissions.csv"
  </code></pre>
  
  <p><strong>Error</strong>:</p>
  
  <pre><code>Get-Acl : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
  At line:7 char:16
  + $Acl = Get-Acl $Folder2.FullName
  +                ~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidData: (:) [Get-Acl], ParameterBindingValidationException
  </code></pre>