If you get during your script debugging the following error:
format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly
The reason for this is a cmdlet that is not intercepted. For example, calling an
Add-PnpListItem without processing the result of the function.
This error occurs only during debugging and is unimportant.
If this error disturbs you, you can pass the call in a variable or redirect the result.
$v = Add-PnpListItem
Add-PnpListItem | out-null