An exception occurs in Test on both NTFS and Registry resources when ACLRules first addition is only a single object and not an array. Subsequent additions throw an exception because there is no add method on PSObjects. Fix is to instantiate ACLRules as an array at the beginning of the function.
An exception occurs in Test on both NTFS and Registry resources when ACLRules first addition is only a single object and not an array. Subsequent additions throw an exception because there is no add method on PSObjects. Fix is to instantiate ACLRules as an array at the beginning of the function.