Wanted to share quick code snippet for how to detect if current PS1 host environment is Azure RUNBOOK or LOCAL console like POWERSHELL_ISE or POWERSHELL.EXE. Cheers.
SCREENSHOT
CODE
if ($host.Runspace) {if ($host.Runspace[0].GetType().Name -eq “LocalRunspace”) {$local=$true; “LOCAL”}} else {“RUNBOOK”}
Wanted to share quick trick on how to detect where your M365 tenant is hosted. Simply open URL below with tenant URL in the middle. Response JSON contains property “tenant_region_scope”:”NA” showing the physical host location. Cheers.
NOTE – For tenants hosted on GCC or you will see an extra property “tenant_region_sub_scope”:”GCC”
Wanted to share step-by-step procedures for how to connect PNP.PowerShell console to SharePoint Online. Three major methods are outlined below, each slightly more advanced than the previous. Drop any questions or comments at bottom of post. Cheers.
VIDEO 1 – Client ID and Client Secret plain text
Demo how to connect with Client ID and Client Secret plain text running PNP.PowerShell.
Steps are included for
Register application with SharePoint Online (SPO) by opening “appregnew.aspx”
Grant permission with SharePoint Online (SPO) by opening “appinv.aspx”
Connect-PNPOnline using Client ID and Client Secret plain text Cheers