Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

PowerShell Custom PSSnapIn deployment failure

$
0
0

Hello,

I created a sample of custom PSSnapin, and I want to deploy it, the project was created as Class Library project, with signed key...

The project was containing the following code:

[RunInstaller(true)]
    public class PowerPSSnapin : PSSnapIn
    {
        public override string Description
        {
            get { return "This is the Custom PSSnapin Sample"; }
        }

        public override string Name
        {
            get { return "3TSolutions PSSnapinSample"; }
        }

        public override string Vendor
        {
            get { return "EURL 3TSolutions"; }
        }
    }


and a sample of cmdlet just to display:

[Cmdlet(VerbsCommon.Show, "InvokeCmd")]
    public class InvokeCmd : PSCmdlet
    {
        protected override void BeginProcessing()
        {
            WriteObject("Begin processing !!");
        }

        protected override void EndProcessing()
        {
            WriteObject("End processing !!");
        }

        protected override void StopProcessing()
        {
            WriteObject("Stop processing !!");
        }

        protected override void ProcessRecord()
        {
            WriteObject("Cmdlet is processing !!");
        }
    }


I ran the utilities to add the signed assembly to the GAC using gacutil.exe, the assembly was successfully added.

but when I ran the IntallUtil.exe command, it failed and it generated this log :

Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\Windows\assembly\GAC_MSIL\PowerSnapin\1.0.0.0__31c73baa74834c3c\PowerSnapin.dll assembly's progress.
The file is located at C:\Windows\assembly\GAC_MSIL\PowerSnapin\1.0.0.0__31c73baa74834c3c\PowerSnapin.InstallLog.

An exception occurred during the Install phase.
System.Management.Automation.PSArgumentException: The format of the specified snap-in name was not valid.  Windows PowerShell snap-in names can only contain alpha-numeric characters, dashes, underscores and periods. Correct the name and then try the operation again.

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\Windows\assembly\GAC_MSIL\PowerSnapin\1.0.0.0__31c73baa74834c3c\PowerSnapin.dll assembly's progress.
The file is located at C:\Windows\assembly\GAC_MSIL\PowerSnapin\1.0.0.0__31c73baa74834c3c\PowerSnapin.InstallLog.

The Rollback phase completed successfully.

The transacted install has completed.

Does it something missing or not configured ? please help me.

Thank you in advance.




Viewing all articles
Browse latest Browse all 2562

Trending Articles