Hi Cliff,
Thank you for help.
My OS is windows 10 pro
The version is as follow:
Name Value
---- -----
PSVersion 5.1.19041.1645
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1645
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Microsoft .NET Framework 3.5.x was not enabled, I enabled it and restarted my computer and I am logged in as administrator to PS ISE, ran the commands again, got the following error.
PS C:\WINDOWS\system32> Install-Module msonline
PS C:\WINDOWS\system32> Import-Module msonline
Import-Module : Could not load file or assembly 'file:///C:\Program
Files\WindowsPowerShell\Modules\msonline\1.1.183.66\Microsoft.Online.Administration.Automation.PSModule.dll' or one of its dependencies. An attempt was made to load a
program with an incorrect format.
At line:1 char:1
+ Import-Module msonline
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], BadImageFormatException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
The execution policy set to unrestricted