Hi There,
The last bit of code, how can I do this in powershell. I have managed to get an access token with Powershell commands.
csom.ProjectContext psCtx = new csom.ProjectContext(pwaInstanceUrl);
psCtx.ExecutingWebRequest += (s, e) =>
{
e.WebRequestExecutor.RequestHeaders["Authorization"] = "Bearer " + TokenResult.AccessToken;
};
I now need to connect to the project context using similar code to below but use the token instead of user/password. Microsoft.SharePoint.Client.SharePointOnlineCredentials does not provide the authentication in an Azure function as it does when run from desktop?
$ProjCtx = New-Object Microsoft.ProjectServer.Client.ProjectContext($siteURL)
[Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName, $Cred.Password);
$ProjCtx.Credentials = $spocreds