I wrote a powershell script and I would like you to varify if it is a good one.
So the goal of this script is that it will retrieve a specific site and will modify the name of a persmission level, so the permission shouldn't be adjusted only the name.
The thing is I have a permission with a strange name there, so I need to update it to a more reasonable name.
Here is the code that I have:
function ModifyPermissionForSite()
{
$site=get-CsWebAppUrl()+"/SiteName"
$web =site.RootWeb
$roleCollection=$web.RollDefinitions
$role=$roleCollection["Auto-generated Permission Level"]
$role.Name="New Persmission level name"
$web.Upate()
Write-Host "$($role) is updated to a new value!" -ForegroundColor green
}