Cli-microsoft365: New command: Set classification label

Created on 27 Jan 2019  路  6Comments  路  Source: pnp/cli-microsoft365

Sets classification label on the specified list

command: spo list label set -u|--webUrl <webUrl> -l|--listId [listId] -t|--listTitle [listTitle] --label <label> --syncToItems --blockDeletion --blockEdit

  • webUrl: The URL of the site where the list is located
  • listId: The ID of the list on which to set the label. Specify listId or listTitle but not both
  • listTitle: The title of the list on which to set the label. Specify listId or listTitle but not both
  • label: The label to set on the list
  • syncToItems: Specify, to set the label on all items in the list
  • blockDeletion: Specify, to disallow deleting items in the list
  • blockEdit: Specify, to disallow editing items in the list

For more information see: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/set-pnplabel?view=sharepoint-ps

good first issue new feature work in progress

All 6 comments

@waldekmastykarz do you know if there is a rest for that or we have to do it the old school way?

Assign me please.

I haven't looked at what API is exactly called by PowerShell, but once you do, you could check _api/$metadata for anything alike

Hey @waldekmastykarz , I will add listUrl (server relative or web relative) as param. Are you ok?

Hey @waldekmastykarz, I will also rename the --blockDeletion to --blockDelete because this is how it is being specified in the $metadata. Are you ok?

image

@waldekmastykarz , the PR is submitted. One thing I am not certain of is how blockEdit and blockDelete work. I am calling the right REST with the right payload, but I was not able to make it work as per your description up in the command. I do not know how it is suppose to work either, but I was not able to make it work with the PnP PowerShell command either.

I might be doing something wrong. Could you please test and let me know if we should change something.

I had a look at the API call and seemed all fine. If there is an API issue, then we should circle it back to Microsoft.

Was this page helpful?
0 / 5 - 0 ratings