I'm using Google Translate so it won't be accurate. currently I am having problem with sharing the directory tree. I have a directory tree like the one in the picture. I have written a command line to run but it has an error, I use it on my computer and it runs normally, but when I apply it to another machine, it fails. Any help with handling?
$mypath = "D:\KIEM TRA1"
$myacl = Get-Acl $mypath
$myaclentry = "EMC0\test.ktnb","readandexecute,write","Allow"
$myaccessrule = New-Object System.Security.AccessControl.FileSystemAccessRule($myaclentry)
$myacl.SetAccessRule($myaccessrule)
Get-ChildItem -Path "$mypath" -Recurse -Force | Where-Object { $_.Name -eq 'A' -or $_.Name -eq 'B' } | Set-Acl -AclObject $myacl -Verbose