New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-SPOTermGroup (v16) broken #120

Closed
Jason01450 opened this Issue Oct 31, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@Jason01450

Jason01450 commented Oct 31, 2015

If you connect to an O365 tenant with an appropriately permissioned account and try to create a new term group ala:

Add-SPOTaxonomyField -GroupName "Test01"

the term group is created, however it looks like there is something wrong with the object returned.

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 requested. + CategoryInfo : NotSpecified: (:) [format-default], CollectionNotInitializedException + FullyQualifiedErrorId : Microsoft.SharePoint.Client.CollectionNotInitializedException,Microsoft.PowerShell.Commands.FormatDefa ultCommand

Other term group related commands are also not working, but I'm guessing this is the root cause. It looks to me as if the collection returned is throwing an error.

@erwinvanhunen

This comment has been minimized.

Show comment
Hide comment
@erwinvanhunen

erwinvanhunen Nov 21, 2015

Collaborator

Hi!

This is actually expected behaviour and is due to the way CSOM works. The Client Side Object Model that the cmdlets use behind the scenes do not load all properties by default. This is to reduce the payload that goes over the 'wire' and make the server perform faster. PowerShell however wants to resolve all properties when an object is returned and there is where this error message comes from. You can suppress this error message by simply putting the result of the cmdlet in a variable. For instance

$field = Add-SPOTaxonomyField -GroupName "Test01" etc. etc.

The $field variable you can then simply ignore, or use later in retrieving additional property with

Get-SPOProperty -ClientObject $field -Property "ThePropertyToLoad"
Collaborator

erwinvanhunen commented Nov 21, 2015

Hi!

This is actually expected behaviour and is due to the way CSOM works. The Client Side Object Model that the cmdlets use behind the scenes do not load all properties by default. This is to reduce the payload that goes over the 'wire' and make the server perform faster. PowerShell however wants to resolve all properties when an object is returned and there is where this error message comes from. You can suppress this error message by simply putting the result of the cmdlet in a variable. For instance

$field = Add-SPOTaxonomyField -GroupName "Test01" etc. etc.

The $field variable you can then simply ignore, or use later in retrieving additional property with

Get-SPOProperty -ClientObject $field -Property "ThePropertyToLoad"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment