I'm having no problem installing EXO V3.1.0 under either PowerShell 5 (5.1.17763.3770) or PowerShell 7 (7.3.1), but when I try to execute a simple script, I see different results:
Import-Module PowerShellGet
[string]$username = 'email address removed for privacy reasons'
[string]$password = 'password'
[securestring]$secPassword = ConvertTo-SecureString $password -AsPlainText -Force
[pscredential]$cred = New-Object System.Management.Automation.PSCredential ($username, $secPassword)
$con = Connect-ExchangeOnline -credential $cred
get-connectioninformation
In PowerShell 7, I get back results without any issue. However, under PowerShell 5, I consistently see an exception (reproduced on two separate machines) when Connect-ExchangeOnline is called:
Cannot update the manifest file 'C:\Users\MY_USER\AppData\Local\Temp\2\tmpEXO_bd2p0xyh.zpt\tmpEXO_bd2p0xyh.zpt.psd1' because the manifest is not valid. Verify that the manifest file is valid, and then try again.'The member
'FormatsToProcess' in the module manifest is not valid: Cannot find path 'C:\Users\MY_USER\AppData\Local\Temp\2\684306234\exchange.format.ps1xml' because it does not exist.. Verify that a valid value is specified for this
field in the 'C:\Users\MY_USER\AppData\Local\Temp\2\684306234\NewManifest.psd1' file.'
At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.1.0\netFramework\ExchangeOnlineManagement.psm1:733 char:21
+ throw $_.Exception;
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentException
+ FullyQualifiedErrorId : Cannot update the manifest file 'C:\Users\MY_USER\AppData\Local\Temp\2\tmpEXO_bd2p0xyh.zpt\tmpEXO_bd2p0xyh.zpt.psd1' because the manifest is not valid. Verify that the manifest file is valid, an
d then try again.'The member 'FormatsToProcess' in the module manifest is not valid: Cannot find path 'C:\Users\MY_USER\AppData\Local\Temp\2\684306234\exchange.format.ps1xml' because it does not exist.. Verify that a valid value is specified for this field in the 'C:\Users\MY_USER\AppData\Local\Temp\2\684306234\NewManifest.psd1' file.'
These results are from the command-line, but I'm actually working with PowerShell from within a C# application and the runspace version shows v5 PowerShell (which is the version I need to support). Any ideas?