Skip to content
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

[BUG] Get-PnPTerm fails with -Includes #1304

Closed
paylord opened this issue Oct 26, 2021 · 6 comments · Fixed by #1384
Closed

[BUG] Get-PnPTerm fails with -Includes #1304

paylord opened this issue Oct 26, 2021 · 6 comments · Fixed by #1384
Labels
bug Something isn't working

Comments

@paylord
Copy link
Contributor

paylord commented Oct 26, 2021

Reporting an Issue or Missing Feature

Get-PnPTerm is throwing an error when trying to use the -Includes parameter

Expected behavior

I would expect to be able to use -Includes to populate additional properties as part of Get-PnPTerm.

Actual behavior

Get-PnPTerm is working fine:
PS C:\WINDOWS\system32> $term = Get-PnPTerm -Identity '37982bc4-efea-4b32-af8e-56135a773b70'
PS C:\WINDOWS\system32> $term

Name Id Child Terms


Train 03 37982bc4-efea-4b32-af8e-56135a773b70 0 (Not loaded)

With -Includes throws an error:
PS C:\WINDOWS\system32> $term = Get-PnPTerm -Identity '37982bc4-efea-4b32-af8e-56135a773b70' -Includes Parent
Get-PnPTerm : Cannot bind positional parameters because no names were given.
At line:1 char:9

  • $term = Get-PnPTerm -Identity '37982bc4-efea-4b32-af8e-56135a773b70' ...
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Get-PnPTerm], ParameterBindingException
    • FullyQualifiedErrorId : AmbiguousPositionalParameterNoName,PnP.PowerShell.Commands.Taxonomy.GetTerm

PS C:\WINDOWS\system32>

Steps to reproduce behavior

See above example

What is the version of the Cmdlet module you are running?

1.8

Which operating system/environment are you running PnP PowerShell on?

  • [ X] Windows
@paylord paylord added the bug Something isn't working label Oct 26, 2021
@KoenZomers
Copy link
Collaborator

@paylord Thanks for reporting this. This should be fixed with PR #1384 that is going to be merged in a minute. Please try this again with the latest prerelease earliest tomorrow. In case it still does not work, feel free to report back.

@paylord
Copy link
Contributor Author

paylord commented Nov 26, 2021

@KoenZomers - I installed using Install-Module PnP.PowerShell -AllowPrerelease -SkipPublisherCheck -Force and it now shows as using 1.8.48.

Still getting the same error in both PS v5 and v7 :(

@paylord
Copy link
Contributor Author

paylord commented Nov 26, 2021

@KoenZomers looks like I might have been a bit too quick off the mark - in Australia so timing is likely out a bit :)

Will try again Monday morning.

@KoenZomers
Copy link
Collaborator

@paylord Sorry didn't realize you were on the other end of the globe :) The new version is 1.8.49 and is out now for you to try this: https://www.powershellgallery.com/packages/PnP.PowerShell/1.8.49-nightly

@paylord
Copy link
Contributor Author

paylord commented Nov 30, 2021

@KoenZomers Now on 1.8.53 and can confirm it is correctly pulling back the parent if it is a Term and pulls back an empty object if the parent is a TermSet. Thanks for the support :)

@KoenZomers
Copy link
Collaborator

Thanks for checking and confirming @paylord !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants