Is there a way to Create a context in powershell using Client Id and Client Secret ?
Currently I am using $context.Credentials
in my code.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityYou can use PnP PowerShell to connect to SharePoint using client id as below:
Connect-PnPOnline -Url <url> -AppId <clientid> -AppSecret <clientsecret>
$context = Get-PnPContext
Reference - Connect-PnPOnline
Download - PnP PowerShell releases
If you have PowerShellGet installed, you can directly install it using Install-Module SharePointPnPPowerShellOnline