VI Permission Category
Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations
Step 1: Retrieve a object by running a Get command
# Retrieves the permissions of the Administrator user on the provided datacenters.
Get-VIPermission -Entity (Get-Datacenter) -Principal Administrator
Step 2 : Run commands from the CRUD group
# Creates a permission on the provided server for a role with the specified privileges.
New-VIRole -Name Role -Server $server -Privilege (Get-VIPrivilege -PrivilegeGroup) $permission = New-VIPermission -Role Role -Principal Administrator -Entity (Get-Datacenter)
# Changes the Propagate property of the $permission permission to $false.
Set-VIPermission -Permission $permission -Role Role -Propagate:$false
# Removes the $permission permission without asking for confirmation.
Remove-VIPermission -Permission $permission -Confirm:$false