Set folder permissions to a folder sub folders and all files inside that

I have a specific post on How to Log built-in PowerShell commands (non-PSADT commands)

I don’t have an example for Set-Acl so try the following:

    $folder_to_change = "${env:ProgramFiles(x86)}\ThinkMedia 2.0\"
    If (Test-Path $folder_to_change) {
      Write-Log -Message "Updating ACL for [$folder_to_change]..." -Source ${CmdletName} -LogType 'CMTrace'
      $rule = new-object System.Security.AccessControl.FileSystemAccessRule ("BUILTIN\Users","Modify","ContainerInherit,ObjectInherit","None","Allow")
      $FolderACL = Get-ACL -Path $folder_to_change
      $FolderACL.SetAccessRule($rule)
      Set-ACL -Path $folder_to_change -AclObject $FolderACL -Verbose *>&1 | Out-String | write-log
      Write-Log -Message 'Updated ACL for $folder_to_change successfully ' -Source ${CmdletName} -LogType 'CMTrace'
    }

BTW: PSADT v3.9.x also has a Set-ItemPermission function.