powershell icon indicating copy to clipboard operation
powershell copied to clipboard

Clear-PnPDefaultColumnValues does nothing?

Open jeroenbrussich opened this issue 2 years ago • 3 comments

Discussed in https://github.com/pnp/powershell/discussions/2034

Originally posted by jeroenbrussich June 25, 2022 I have a Documentlibrary on which I want to remove some default Column Values. Idealiter, I only would want to remove some default Values on some folders, but right now I'm desperate enough to nuke all default Values on all Folders and just start over :)

Chances are I don't quite understand how the command is run, so any help would be welcome.

$sharepointSite = "mySharepoint.online/sites/SITE"
Connect-PnPOnline -Url $sharePointSite -ClientId $clientID -Tenant $tenant -Thumbprint $thumbPrint -ErrorAction Stop

# $folder is a folder in `documents`  (List ID= 'C45604CF-73A7-451E-98A0-F0791D8FC3C7)

#  FOLDER = "100008"

Clear-PnPDefaultColumnValues -List 'documents' -Field werkterrein -Folder '100008' 
Clear-PnPDefaultColumnValues -List 'C45604CF-73A7-451E-98A0-F0791D8FC3C7' -Field werkterrein -Folder '100008' 

#   FOLDER = 100008

Clear-PnPDefaultColumnValues -List 'documents' -Field werkterrein -Folder 100008 
Clear-PnPDefaultColumnValues -List 'C45604CF-73A7-451E-98A0-F0791D8FC3C7' -Field werkterrein -Folder 100008 

#   NO FOLDER - RESET FIELD ON TOPFOLDER

Clear-PnPDefaultColumnValues -List 'documents'
Clear-PnPDefaultColumnValues -List 'C45604CF-73A7-451E-98A0-F0791D8FC3C7' 

My parameters seem to be correct, When I change $sharepointSite to only "mySharepoint.online", I get an error. However, when I fiddle with -List, or -Field, things are becoming interesting.

The command runs for an equal amount of time, whether I include -Field or not. What's more, when I -List a non-existent List (Let's say: 'C45604CF-73A7-451E-98A0', or DOCS'), the command keeps running the same amount of time. I get no errors. So it looks like It's timing out?

Using the parameter -verbose does nothing.

So I'm stuck, don't quite know what's going on/wrong and can't debug.

HELP :)

jeroenbrussich avatar Jun 28 '22 07:06 jeroenbrussich

@jeroenbrussich is the type of column a managed metadata column? (the column you're trying to clear default values for)

CallumCrowley avatar Aug 08 '22 15:08 CallumCrowley

Same issue here @CallumCrowley Indeed, for MMD columns

UPDATE - It does work when I add a path in the Folder parameter: Clear-PnPDefaultColumnValues -List 'documents' -Field werkterrein -Folder '/100008'

klaaslauwers avatar Nov 03 '22 13:11 klaaslauwers

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Dec 24 '22 02:12 github-actions[bot]