[MSH] CMDlet Template in VB.NET

Discussion in 'Scripting' started by /\\/\\o\\/\\/, Oct 23, 2005.

  1. in trying to make a CMDlet in VB.net,
    can't get the Alias right.
    the Parameter works, but not the alias.


    <Alias("Origin", "Class")> _
    <Parameter(Position:=0,Mandatory:=true)> _
    Public Property wmiClass() as string

    G:\Monad\CmdLets\let.vb(12) : error BC30183: Keyword is not valid as an
    identifi
    er.

    is there a CDMlet template for VB.NET ?
    I only can find some for C#

    gr /\/\o\/\/
     
    /\\/\\o\\/\\/, Oct 23, 2005
    #1
    1. Advertisements

  2. "Alias" is actually a VB keyword, so it must be changed into
    "AliasAttribute":

    <AliasAttribute("Origin", "Class")> _
    <Parameter(Position:=0, Mandatory:=True)> _
    Public Property wmiClass() As String
    Get
    Return ""
    End Get
    Set(ByVal value As String)
    End Set
    End Property
     
    Jouko Kynsijärvi, Oct 23, 2005
    #2
    1. Advertisements

  3. /\\/\\o\\/\\/

    /\/\o\/\/ Guest

    thx,

    gr /\/\o\/\/

     
    /\/\o\/\/, Oct 24, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.