I am trying to use PowerShell to create a new folder in a Teams document library, using the PnP Sharepoint Online module.
I can authenticate to the site in both PowerShell and in a browser. Then I run this code:
$cred = Get-Credential
$result = Add-PnPFolder -Folder "/sites/SalesDemo/Shared Documents/General/Acme Corp" -Name "testfolder" -Connection (Connect-PnPOnline -Url 'https://tenant.sharepoint.com' -Credentials $cred)
The result looks fine, showing the name, type, items/size, and last modified time, but when I view the site in SharePoint or in Teams, I do not see "testfolder". However, "testfolder" is returned when I run:
Get-PnPFolderItem -FolderSiteRelativeUrl "/sites/SalesDemo/Shared Documents/General/Acme Corp" -ItemType Folder -Connection (Connect-PnPOnline -Url 'https://tenant.sharepoint.com' -Credentials $cred)
Unfortunately, there are other folders in "Acme Corp" that are not returned.
Where is my "testfolder" being created?


