change permissions to folder root and child files and folders

Welcome Forums General PowerShell Q&A change permissions to folder root and child files and folders

Viewing 1 reply thread
  • Author
    Posts
    • #254948
      Participant
      Topics: 5
      Replies: 6
      Points: 55
      Rank: Member

      Hello.

       

      Thanks in advance for assistance with this.

       

      With the below script I am trying to ammend folder permissions for folders, child folders and files from within that folder also.  I can only seem to ge 5 child folders depp though.  I would like to recurivley run this to ensure all child folder permissions are ammended.

       

      Code:

      • This topic was modified 2 weeks, 4 days ago by jimleslie7778.
      • This topic was modified 2 weeks, 4 days ago by kvprasoon.
    • #255086
      Senior Moderator
      Topics: 9
      Replies: 1310
      Points: 4,789
      Helping Hand
      Rank: Community Hero

      What you would probably need is to use -Recurse switch parameter of Get-ChildItem cmdlet then use ForEach-Object cmdlet to iterate through each folder item coming through.
      If you have not used these options, I suggest you to read documentation using Get-Help ForEach-Object -Full cmdlet.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.