Home Powershell Activity

No Module Loaded Error During Test PowerShell Activity

Mike_RistonMike_Riston Customer IT Monkey ✭
Hey all, just got this loaded up and created a super simple  script with
'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!

Any thoughts?

Answers

  • Brett_MoffettBrett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭
    'C:\Program Files\Microsoft System Center 2012 R2\Service Manager\Powershell\System.Center.Service.Manager.psd1'

    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?
  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    i can confirm that i get the same error as above, but we have scsm 2016 installed on Drive E:, and have never installed 2012
    i have the following code in the script to load the smlets from our 2016 install folder.
    if(@(get-module | where-object {$_.Name -eq 'System.Center.Service.Manager'}  ).count -eq 0)
    {
     $InstallationConfigKey = 'HKLM:\SOFTWARE\Microsoft\System Center\2010\Service Manager\Setup'
     $InstallPath = (Get-ItemProperty -Path $InstallationConfigKey -Name InstallDirectory).InstallDirectory + "Powershell\System.Center.Service.Manager.psd1"
     Import-Module -Name $InstallPath -Global
    }

    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


  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    @Mike_Riston and @Brett_Moffett

    I have now logged this as a support ticket with the full script and output I receive
  • Tony_CollettTony_Collett Cireson Support Super IT Monkey ✭✭✭✭✭
    Hi Guys, 

    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. 

    Regards, Tony
  • Mike_RistonMike_Riston Customer IT Monkey ✭
    edited March 2017
    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\). 
    Good catch. I can confirm I have my console installed at D:\Program Files\Microsoft System Center 2012 R2\Service Manager\. 
  • Filip_TheyssensFilip_Theyssens Partner IT Monkey ✭

    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

  • Jonathan_BolesJonathan_Boles Customer Ninja IT Monkey ✭✭✭✭
    Looks like Cireson has fixed this and it will be included in an upcoming release per the problem record with Cireson Support - https://support.cireson.com/Problem/Edit/PR63358/ 
  • Tony_CollettTony_Collett Cireson Support Super IT Monkey ✭✭✭✭✭
    What Jonathan has said is correct. There is currently no ETA on when this will be released. 

    The workaround is still a valid resolution if you require this before the fix:
    Copy the contents of the Powershell folder from E:\Program Files\Microsoft System Center 2012 R2\Service Manager\ (E drive) to C:\Program Files\Microsoft System Center 2012 R2\Service Manager\ (C drive) (you may need to make each folder if they don't exist). 
    The original default directory may change based on install location or SCSM version (2012/2016)
Sign In or Register to comment.