Monthly Archives: March 2020

SharePoint Modern Library Experience: command ribbon

SharePoint Modern Library: Cannot exit “Expand content” mode

After clicking on the “Expand content” command button I have found myself scratching my head:

  • Where is the “Collapse content” command button?
  • Where has the command ribbon gone?
SharePoint Modern Library Experience: “Expand content” command

Well, the command ribbon is still there, it is just hidden by the ‘top placeholder’. Or more precisely, what has loaded into the ‘top placeholder’. For example: Hub Site Navigation or a SPFx Extension.

Having done a few web searches, I’m not the only one seeing this bug and apparently Microsoft is planning to fix the bug. In the meantime, here are two workarounds:

  1. Delete your browser cache (including cookies) and reload the page
  2. Open your browser’s developer tools (e.g. press F12).
    • Select the ‘Console’ tab
    • Paste in the following code
    • Press enter
document.querySelectorAll("button[title='Collapse content']")[0].click();

And now you should see the modern command ribbon again.

Connect-PnPOnline: unwanted credential caching

UPDATE: May 2021

This problem, as described in my original post below, has been fixed for the Connnect-PnPOnline, when using the UseWebLogin param. Plus, the ClearTokenCache parameter is no longer available…

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -UseWebLogin; 

The “new” (or orignal) experience when calling the above Cmdlet will look like the following screen shot:

Login screen: That didn’t work … Here are a few ideas…

For more options, see https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-9

An alternative is to use the Interactive prameter:

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -Interactive; 

For more information, see https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#example-10

Original Post

Since creating a new Windows 10 profile (new PC) the Connect-PnPOnline PowerShell CmdLet has been caching my primary credentials while using the UseWebLogin parameter.

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -UseWebLogin; 

This wouldn’t be a problem if I only worked with on tenant…

After a fair amount of Google searching, mucking around with Internet Explorer and Microsoft Edge settings I found that running the Connect-PnPOnline CmdLet with the following parameters worked:

Connect-PnPOnline -Url "https://[tenant].sharepoint.com" -SPOManagementShell -ClearTokenCache;

Once signed you can revert back to using the UseWebLogin parameter, well until the next time the PowerShell console caches the wrong details… 😉

For more information see: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/connect-pnponline?view=sharepoint-ps