In order to connect to Exchange Online using Power Shell, one needs to have a minimum version of a .NET Framework and a Windows Management Framework running in your computer. The .NET Framework requires a version of 4.5 or later and the Windows Management Framework requires a version of at least 3.0
So before connecting Exchange Online using Power Shell you need to make sure that your system is meeting the minimum requirements. There is a command called as $PSVersion which has to be entered on the Power Shell Command Prompt.
It would list the version against WSManStackVersion. In the above example, the version Installed in the Computer is 3.0