You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current powershell run often does not realise that the taxonomy is called ABC.
Sometimes the importation code fails because "ABC" does not exist, but then if you rerun the same code 5 seconds later, it finds it.
If you wait for 5 seconds using a sleep action, it does not find it, which makes me believe it is an issue with the Client Context not updating, which gets updated when you reattempt.
ErrorRecord : Value cannot be null. (Parameter 'taxonomyItem') WasThrownFromThrowStatement : False TargetSite : System.Collections.ObjectModel.Collection´1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable) Message : Value cannot be null. (Parameter 'taxonomyItem') Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo} InnerException : System.Management.Automation.PSInvalidOperationException: Value cannot be null. (Parameter 'taxonomyItem') at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 101 at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPSharePointCmdlet.cs:line 120 at System.Management.Automation.CommandProcessor.ProcessRecord() HelpLink : Source : System.Management.Automation HResult : -2146233087 StackTrace : at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection´1 input, PSDataCollection´1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection´1 input, PSDataCollection´1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 82 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask´1.ExecuteNormally(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 194
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When creating a site taxonomy via
$termStore = New-PnPSiteCollectionTermStore
Set-PnPTermGroup -Identity $termStore.Id.Guid -Name "ABC"
The current powershell run often does not realise that the taxonomy is called ABC.
Sometimes the importation code fails because "ABC" does not exist, but then if you rerun the same code 5 seconds later, it finds it.
If you wait for 5 seconds using a sleep action, it does not find it, which makes me believe it is an issue with the Client Context not updating, which gets updated when you reattempt.
Import-PnPTermSet -GroupName "ABC" -Path "[redacted]" -SynchronizeDeletions | Out-Null
Other times, this line fails with the error posted below it.
Waiting a few seconds and running the same line shows no error.
Add-PnPTaxonomyField -DisplayName "Subject" -InternalName "InternalSubject" -Group "ABC Columns" -TermSetPath "ABC|Subjects" -Required | Out-Null
ErrorRecord : Value cannot be null. (Parameter 'taxonomyItem') WasThrownFromThrowStatement : False TargetSite : System.Collections.ObjectModel.Collection´1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable) Message : Value cannot be null. (Parameter 'taxonomyItem') Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo} InnerException : System.Management.Automation.PSInvalidOperationException: Value cannot be null. (Parameter 'taxonomyItem') at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 101 at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPSharePointCmdlet.cs:line 120 at System.Management.Automation.CommandProcessor.ProcessRecord() HelpLink : Source : System.Management.Automation HResult : -2146233087 StackTrace : at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection´1 input, PSDataCollection´1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection´1 input, PSDataCollection´1 output, PSInvocationSettings settings) at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings) at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 82 at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask´1.ExecuteNormally(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 194
Beta Was this translation helpful? Give feedback.
All reactions