Forum Discussion
KatoBaade
Jul 14, 2021Copper Contributor
MSOnline not working in PowerShell 7
Greetings, I have installed Windows Terminal with PowerShell 7.1.1 for use with requests related to work as a L1 support tech. I use PowerShell mainly for Exchange-related affairs but from ti...
- Jul 14, 2021On Windows, with PowerShell 5.1 installed, one can import PowerShell modules into a "compatability session". The way you do this is to make sure the PowerShell module is installed using PowerShell 5.1, and using PowerShell 7+ on Windows you can do:
Import-Module MSOnline -UseWindowsPowershell
After this, you can run those cmdlets like you normally would.
pvanberlo
Jul 14, 2021MCT
On Windows, with PowerShell 5.1 installed, one can import PowerShell modules into a "compatability session". The way you do this is to make sure the PowerShell module is installed using PowerShell 5.1, and using PowerShell 7+ on Windows you can do:
Import-Module MSOnline -UseWindowsPowershell
After this, you can run those cmdlets like you normally would.
Import-Module MSOnline -UseWindowsPowershell
After this, you can run those cmdlets like you normally would.
KatoBaade
Jul 14, 2021Copper Contributor
Thanks! This works, but do I need to do this for every new PS instance I run?
- pvanberloJul 14, 2021MCTYes. However, one could decide to add this into a profile script so it’s executed in PowerShell session start.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.1