You cannot call a method on a null-valued expression

So, I am using EXO PowerShell module for quite some time, with everything working out as it should. Two days ago, when I opened the application, it said that update was necessary and I downloaded the installer. Now, however, when I connecting using connect-exopssession -userprincipalname through user@email (like I always do), it returns two errors:

  • You cannot call a method on a null-valued expression.
    At C:\Users\username\AppData\Local\Apps\2.0\WGGQOO9C.LT6\MEGZ44DX.1EJ\micr…tion_5329ec537c0b4b5c_0010.0000_9fc624cd00739
    56e\CreateExoPSSession.ps1:210 char:13
  •         $attributeCollection.Add($attributes)
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:slight_smile: [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull
  • Connect-EXOPSSession : Parameter ‘UserPrincipalName’ cannot be specified in parameter set ‘__AllParameterSets’.
    At line:1 char:1
  • Connect-EXOPSSession -UserPrincipalName user@email
  •   + CategoryInfo          : InvalidArgument: (:) [Connect-EXOPSSession], ParameterBindingException
      + FullyQualifiedErrorId : ParameterNotInParameterSet,Connect-EXOPSSession
    
    

If I run Connect-EXOPSSession without parameters, it shows only the first error. Does anyone know what is going on here? What should I do to evade these errors in the future?

Hello
Please follow the link below
https://social.technet.microsoft.com/Forums/ie/en-US/519ad22b-e256-49bb-a83f-59f1ea5cfc2a/you-cannot-call-a-method-on-a-nullvalued-expression?forum=winserverpowershell