EDUCBA

EDUCBA

MENUMENU
  • Blog
  • Free Courses
  • All Courses
  • All in One Bundle
  • Login
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.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

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
All in One Excel VBA Bundle
500+ Hours of HD Videos
15 Learning Paths
120+ Courses
Verifiable Certificate of Completion
Lifetime Access
Financial Analyst Masters Training Program
2000+ Hours of HD Videos
43 Learning Paths
550+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Data Science Bundle
2000+ Hour of HD Videos
80 Learning Paths
400+ Courses
Verifiable Certificate of Completion
Lifetime Access
All in One Software Development Bundle
5000+ Hours of HD Videos
149 Learning Paths
1050+ Courses
Verifiable Certificate of Completion
Lifetime Access
Primary Sidebar
All in One Data Science Bundle2000+ Hour of HD Videos | 80 Learning Paths | 400+ Courses | Verifiable Certificate of Completion | Lifetime Access
Financial Analyst Masters Training Program2000+ Hours of HD Videos | 43 Learning Paths | 550+ Courses | Verifiable Certificate of Completion | Lifetime Access
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

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

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

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

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

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more