Search code examples
powershellsessionoauthpowershell-cmdlet

New-PSSession Cmdlet using Oauth credentials


I would like to create a New-PSSession using an access token (Oauth) and not a default credentials.

Is it possible?

According to documentation, these are the authentications types:

  • Default
  • Basic
  • Credssp
  • Digest
  • Kerberos
  • Negotiate
  • NegotiateWithImplicitCredential

Thanks!


Solution

  • New-PSSession connects with PS Remoting (WinRM) which does not support OAuth authentication. You can supply a PSCredential object used to get that OAuth token instead, if any.