EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up
Home Data Science Data Science Tutorials PowerShell Tutorial Get Command in PowerShell
 

Get Command in PowerShell

Priya Pedamkar
Article byPriya Pedamkar

Updated March 23, 2023

Get-command-in-PowerShell

 

 

Introduction to Get Command in PowerShell

Windows PowerShell is a scripting language that is built on .net platform designed to automate the tasks related to windows application and administration. The term PowerShell is a combination of the language and the interface in which the commands/scripts will be run. The first version of PowerShell was introduced in the year 2006. There are two types of interface where can PowerShell commands can be run; windows PowerShell is like a command prompt where PowerShell cmdlets can be run, and Windows PowerShell ISE is where PowerShell scripts (a compilation of PowerShell cmdlets) can be run and debugged. It is an object-oriented language thereby allowing it to integrate with .net interfaces. It is now open-source and can be installed on another OS’s as well.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

To start a PowerShell session, type “PowerShell” in command prompt.
PowerShell cmdlets and variables

The commands in PowerShell are referred to as “cmdlets”. The most important of all cmdlets is the Get-Command. This cmdlet returns the list of all available cmdlets in PowerShell.

Syntax:

The following is the syntax of the Get-Command cmdlet.

Get-Command
[[-Name] <String[]>] [-Module <String[]>] [-FullyQualifiedModule <ModuleSpecification[]>] [-CommandType <CommandTypes>] [-TotalCount <Int32>] [-Syntax] [-ShowCommandInfo] [[-ArgumentList] <Object[]>] [-All] [-ListImported] [-ParameterName <String[]>] [-ParameterType <PSTypeName[]>] [-UseFuzzyMatching] [<CommonParameters>]

Eg: Get-Command

Sample Output:

Get command in PowerShell output 1

To fetch the cmdlets that are available in the current session, the following cmdlet can be used.

Get-Command -ListImported

Parameters of Get-Command in PowerShell

Here are the following parameters of Get-Command in PowerShell mention below

  • All: This denotes that all the cmdlets need to be retrieved. Its type is the switch parameter. The default value is none and it doesn’t accept wild card characters.
  • ArgumentList: This is used to retrieve information about the cmdlets with the help of specified parameters. Its type is of the object. Alias is Args. The default value is none and doesn’t accept wild characters.
  • CommandType: This denotes the types of commands that are returned by the cmdlet. Some of its values are Alias, All, Application, External Script, Filter and Function. Its type is command type and aliases is Type. The default value is none and doesn’t accept wild card characters.
  • FullyQualifiedModule: Returns the cmdlets that are with the specified module names. Its type is module specification. The default value is none and doesn’t accept wild card characters.
  • ListImported: Returns cmdlets that are present in the current session. Its type is the switch parameter. The default value is none and doesn’t accept wild card characters.
  • Module: Returns the cmdlet that is available in the specified module. Type is string, the default value is none and accepts wild card characters.
  • Name: This returns the list of mentioned cmdlets with the specified names. Wild card characters are allowed. Type is string, the default value is none.
  • Noun: Returns the cmdlets, functions, and aliases that contain the same noun or nouns as specified. Its type is a string and the default value is none. Accept wild card characters.
  • ParameterName: Returns the cmdlets in the current session with the specified parameters. Its type is string, the default value is none and doesn’t accept wild card characters.
  • ParameterType: Returns the cmdlets in the session that have the same parameter as the specified type. Its type is PStypename. The default value is none and doesn’t accept wild card characters.
  • TotalCount: Denotes the total number of cmdlets to be returned. The type is Int32. The default value is none and does not accept wild card characters.
  • Verb: Returns the cmdlets, functions, and aliases that contain the same verb or verbs as specified. Its type is a string and the default value is none. Accept wild card characters.

Examples of Get command

Here are the Examples of Get command in PowerShell mention below

Example #1

Get cmdlets in the current session

Input:

Get-Command -ListImported

Output:

Get command in PowerShell output 2

Example #2

Get cmdlets inside the specified module

Input:

Get-Command -Module Microsoft.PowerShell.Management

Output:

output 4

Example #3

Find the cmdlets that an output type

Input:

Get-Command -Type Cmdlet | Where-Object OutputType | Format-List -Property Name, OutputType

Output:

output 5

Conclusion – Get command in PowerShell

Thus, the article covered in detail about the Get-command cmdlet in Powershell. For detailed information, it is advisable to use the Get-Help command for get-command.

Recommended Articles

This is a guide to Get command in PowerShell. Here we discuss the Parameters and Examples of Get command in PowerShell along with input and output.  You may also look at the following article to learn more –

  1. Hibernate Mapping
  2. PowerShell String Functions
  3. JSP Directives
  4. What is PowerShell
  5. Complete Overview with Examples of PowerShell Date
  6. Help Command in Linux

Primary Sidebar

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

EDUCBA Login

Forgot Password?

🚀 Limited Time Offer! - 🎁 ENROLL NOW