CopyPastor

Detecting plagiarism made easy.

Score: 0.8342478275299072; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2019-02-08
by pjhsea

Original Post

Original - Posted on 2019-02-08
by pjhsea



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Also ensure that the cmdlet class is *public*. For [example][1], in my .cs file I initially had:
``` [Cmdlet(VerbsCommon.Get, "Proc")] class GetProcCommand : Cmdlet { ... ```
Even after adding a manifest file with `RootModule` set, `Get-Module` continued to show no `ExportedCommands` after my `Import-Module`. To fix it I just marked the class as public and rebuilt my .dll assembly:
``` [Cmdlet(VerbsCommon.Get, "Proc")] public class GetProcCommand : Cmdlet { ... ```
I figured this out while examining my .dll using [ildasm][2] - I noticed that some of my classes were public, but my cmdlet class was private.
[1]: https://docs.microsoft.com/en-us/powershell/developer/cmdlet/cmdlet-attribute-declaration [2]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/assemblies-gac/how-to-determine-if-a-file-is-an-assembly
One other requirement: ensure that the cmdlet class is *public*. For [example][1], in my .cs file I initially had:
``` [Cmdlet(VerbsCommon.Get, "Proc")] class GetProcCommand : Cmdlet { ... ```
Even after adding a manifest file with `RootModule` set, `Get-Module` continued to show no `ExportedCommands` after my `Import-Module`. To fix it I just marked the class as public and rebuilt my .dll assembly:
``` [Cmdlet(VerbsCommon.Get, "Proc")] public class GetProcCommand : Cmdlet { ... ```
I figured this out while examining my .dll using [ildasm][2] - I noticed that some of my classes were public, but my cmdlet class was private.
[1]: https://docs.microsoft.com/en-us/powershell/developer/cmdlet/cmdlet-attribute-declaration [2]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/assemblies-gac/how-to-determine-if-a-file-is-an-assembly

        
Present in both answers; Present only in the new answer; Present only in the old answer;