SMLets in .Net application

Nov 2, 2011 at 3:26 PM

I have used PowerShell from .Net Applications in the past. I am trying to use PowerShell to create Incidents in Service Manager from a home-grown application to track work being done. When I call my script, from my application I get an error that Get-SCSMRelationshipClass isn't a known cmdlet or script, etc. At the top of my script I have Import-Module SMLets, but that doesn't seem to help. I have even used the path to the .psm1 file to see if it will import, but it does not. I tried a different script to just import SMLets and then did a Get-Module SMLets and it didn't return anything. Has anyone had success with using the SMLets via a .Net application?


Nov 3, 2011 at 10:34 PM

I found the resolution to this.

1) This was being ran from a non-Management Server, so I followed the steps here:

2) The SMLets module was being installed in c:\windows\sytem32\windowspowershell\v1.0\ and when I was using .Net to call PowerShell, it was only looking in c:\windows\syswow64\windowspowershell\v1.0\. I copied the SMLets folder to the x64 directory and the module was listed. I imported it and everything worked as I expected.

Thanks so much for the SMLets!! We are moving to SCSM from another tool and we need to track work done in our outside systems in SCSM. This will be a great resource for us.

Thanks again!