Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:46:47+00:00 2026-06-15T06:46:47+00:00

I am writing custom Powershell cmdlets for my application and I need to provide

  • 0

I am writing custom Powershell cmdlets for my application and I need to provide Aliases to some cmdlets. So lets say I have cmdlet Get-DirectoryListing and I want to add Alias (say ‘gdl’) to this cmdlet. How can I do this?

The AliasAttribute doesn’t work here, since it works only with Properties, Indexers or Field declarations. Also I know we can use Set-Alias command, but don’t know where to put it.

Is it possible to programmatically add multiple aliases to a cmdlet?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:46:48+00:00Added an answer on June 15, 2026 at 6:46 am

    You need to create a psm1 file (powershell module) where you specific your dll with yours cmdlets to load and add aliases in this way:

    In your module folder ( Get-ModuleFolder give a list of all if you have more that the default one, in my example I use the first one) create a folder with same name of your .dll
    and a SameNameOfYourDll.psm1 with this content:

    Import-module "$((Get-ModulePath)[0])mycustomcmdlet\mycustomcmdlet.dll"
    set-alias gdl Get-DirectoryListing -scope Global
    

    For more raffinate module building look also at module manifest

    Module manifest is the preffered way for .dll with custom cdmlets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a release script in powershell and need to invoke a custom
I need help writing custom functions for my casio fx-9860g I have done this
I am writing Plugin for some Application. Lets suppose that Application hava library dependency
I'm writing a custom PowerShell cmdlet, and I would like to know which is
Recently I've decided to get some knowledge about writing custom tags. And there is
Lets say I have a custom control called FooBox. It is just a square
I'm writing a custom overlay for a Google Map. I have a serious of
Im writing custom docs for some java methods, and some of them are overloaded
I am constantly writing custom WebParts but after I deploy them, they always get
I am writing custom code to create a blog. I need the archives page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.