pschaeflein / MagicTooltips

PowerShell module to display contextual information about the command you're currently entering.
MIT License
18 stars 3 forks source link

Add support for PnP.Powershell #4

Open pschaeflein opened 3 years ago

pschaeflein commented 3 years ago

Info: Installing PnP PowerShell

Get-PnPConnection

https://twitter.com/ToddKlindt/status/1402269525769326592?s=20

anoopt commented 3 years ago

@pschaeflein - Not sure if this helps - when connected to a SharePoint site using PnP PowerShell, a couple of environment variables will have values set in them. Those variables are $env:PNPPSSITE and $env:PNPPSHOST

image

Source - https://www.erwinmcm.com/pimp-your-pnp-powershell/

pschaeflein commented 3 years ago

Thanks so much!!!

Couple of questions: 1) What if you are not connected? Variables missing or empty? 2) Is there a variable with the user name? 3) Would you prefer the connected site instead of the account? Or both?

anoopt commented 3 years ago

No worries Paul. Please find the answers below

  1. What if you are not connected? Variables missing or empty? The values are null. image

  2. Is there a variable with the user name? I don't think there is a variable with user name. Maybe @gautamdsheth can provide more information.

  3. Would you prefer the connected site instead of the account? Or both? Since we can connect either with an account or an app reg, personally for me, connected site only is fine.