hope you can help me out. I'm working on a powershell script performing serveral modifications on a sharepoint environment.
I want to copy the RoleAssignments from on web to an other in the same site collection. Basicly it works when i run my commands manual in the console but it doesent work while running the script.
What I do is this.
$RoleAssignmentMember = $RoomWebRoleAssignment.Member
$RoleBindings = $RoomWebRoleAssignment.RoleDefinitionBindings
$ctx.Load($RoleAssignmentMember)
$ctx.Load($RoleBindings)
$ctx.ExecuteQuery()
$Web.RoleAssignments.Add($RoleAssignmentMember, $RoleBindings)
$ctx.ExecuteQuery()
Running $Web.RoleAssignments.Add($RoleAssignmentMember, $RoleBindings) in console works.. not in the script .. I got an error that the collection is not ready .. but acutally it is^^..
Any Ideas ? Hope you can help Greetz