Skip to content

[BUG] Includes parameter doesn't seem to be working with Get-PnPFolder #2595

@PowershellScripts

Description

@PowershellScripts

Notice

I don't have the skill to assess if the issue lies in https://github.com/pnp/powershell/blob/c13d935686dcac6c3949e8fb7861b5ce26135110/src/Commands/Base/PnPRetrievalsCmdlet.cs or somewhere else

Reporting an Issue or Missing Feature

When trying to load additional properties for a folder using Get-PnPFolder and -Includes parameter, they don't seem to be loaded. It works if the same property is retrieved with $context.load(). Here the examples use ParentFolder property. I got the same behaviour with ContentTypeOrder, Folders.Count, or Files.

PS C:\WINDOWS\system32> $fWithInclude = Get-PnPFolder -List dokus -Includes ParentFolder
PS C:\WINDOWS\system32> $fWithInclude[0].ParentFolder
Name Type   Items/Size Last Modified
---- ----   ---------- -------------
     Folder    

Expected behavior

I'd expect the same behaviour as with Get-PnPList -Includes:

image

Actual behavior

image

Steps to reproduce behavior

$fWithInclude = Get-PnPFolder -List dokus -Includes ParentFolder
$fWithInclude[0].ParentFolder

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

1.12.19

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

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions