Powershell doesn't work properly after migration Legacy -> Windows

Hello guys,

I have following problem - after migration to Windows project, my powershell scripts stopped working. It starts to throw an error: Invoke Power Shell: The 'Get-ADGroup' command was found in the module 'ActiveDirectory', but the module could not be loaded. For more information, run 'Import-Module ActiveDirectory'. When I go back to legacy version, it works again. Interesting fact is, when I open PowerShell manually and paste script there, it works. Does anybody had such problem?