Problem creating Request offering

Jul 16, 2012 at 8:53 AM
Edited Jul 16, 2012 at 9:31 AM

Hello,

I'm trying to create a Request Offering by running a powershell script. Below my code:

 

Import-Module SMLets
$tmp = Get-SCSMRequestOffering -DisplayName "Cannot access to my voicemail"

$template = Get-SCSMObjectTemplate -Name "Template.e5d01c440b0c461d978cd3b8c606ced1"

$managementPack = Get-SCSMManagementPack -Name "ManagementPack.469eecac8c4a480087ee61fbc1b0b4c6"
New-SCSMRequestOffering -Status "Draft" -TargetTemplate $template -Title "test" -ManagementPack $managementPack

 

 

When I execute it I get the following error:

New-SCSMRequestOffering : Object reference not set to an instance of an object.At line:2 char:24
+ New-SCSMRequestOffering <<<< -Notes "NGIT" -Status "Draft" -TargetTemplate $template -Title "Cannot access to my voicemail" -ManagementPack $managementPack
    + CategoryInfo
         : NotSpecified: (:) [New-SCSMRequestOffering], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,SMLets.NewSCSMRequestOfferingCommand

 

Could you give me an hint about how to troubleshoot it or show me the correct way of using New-SCSMRequestOffering SMlets?

Thank you for your help.

Marco