No Module Loaded Error During Test PowerShell Activity
'Write-Output "Test!"'as the contents and am receiving the following error in the PowerShell Output. You can see it does actually Write-Output "Test!", but also catches an error trying to load the SM psd1 file.
An error was written to the Error stream! The specified module 'C:\Program Files\Microsoft System Center 2012 R2\Service Manager\Powershell\System.Center.Service.Manager.psd1' was not loaded because no valid module file was found in any module directory. Test!
Can you confirm this file actually exists in your environment?
Where are you getting the error? In the log file or in the Output Text?
i have the following code in the script to load the smlets from our 2016 install folder.
and there is no other reference i can find to the default 2012 install path.
this is causing all the powershell activities to be marked as failed, even though the scripts do run and work successfully apart from this error showing at the top of the powershell output tab
current version of the powershell activity we have installed is 1.0.2016.16
I have now logged this as a support ticket with the full script and output I receive
Thanks for bringing this to our attention. This error occurs if the SCSM console is installed in a location that is not the default directory (i.e C:\Program Files\Microsoft System Center 2012 R2\Service Manager\). The Powershell Activity app is trying to find the default location, but it should be searching for the installed location of SCSM instead.
I have escalated this fault to our developers. I will let you know when a fix is available.
I'm seeing the same error.
My console is installed in the default location:
"C:\Program Files\Microsoft System Center 2012\Service Manager\Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe"
This is an upgraded environment from 2012 R2 towards 2016.
All files are not located in "C:\Program Files\Microsoft System Center 2012 R2" folder but "C:\Program Files\Microsoft System Center 2012"
Any more news on this?
I also logged a ticket for this
The workaround is still a valid resolution if you require this before the fix: