MagicTooltips icon indicating copy to clipboard operation
MagicTooltips copied to clipboard

Add support for PnP.Powershell

Open pschaeflein opened this issue 4 years ago • 3 comments

Info: Installing PnP PowerShell

Get-PnPConnection

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

pschaeflein avatar Jun 08 '21 14:06 pschaeflein

@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/

anoopt avatar Jun 22 '21 21:06 anoopt

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?

pschaeflein avatar Jun 26 '21 19:06 pschaeflein

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.

anoopt avatar Jun 28 '21 14:06 anoopt