Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Find All Parameters for a Cmdlet in PowerShell

September 13, 2023
in Blog, Powershell
0
ADVERTISEMENT

Table of Contents

In this article, we will discuss how to use Get-Command and Get-Help cmdlets in PowerShell to get a list of all available parameters for cmdlet.

Connect-MgGraph

Get Parameters with Get-Command

Using the Get-Command cmdlet in PowerShell, you can get the list of all available parameters for the PowerShell cmdlet. Get-Command cmdlet gets cmdlet all parameters that include required as well as optional parameters.

(Get-Command Connect-MgGraph).Parameters

In the above PowerShell script, Get-Command uses the exact name of the PowerShell cmdlet Connect-MgGraph and uses Parameters to get all parameters for the cmdlet.

Key                    Value
---                    -----
Scopes                 System.Management.Automation.ParameterMetadata
ClientId               System.Management.Automation.ParameterMetadata
CertificateSubjectName System.Management.Automation.ParameterMetadata
CertificateThumbprint  System.Management.Automation.ParameterMetadata
Certificate            System.Management.Automation.ParameterMetadata
ClientSecretCredential System.Management.Automation.ParameterMetadata
AccessToken            System.Management.Automation.ParameterMetadata
TenantId               System.Management.Automation.ParameterMetadata
ContextScope           System.Management.Automation.ParameterMetadata
Environment            System.Management.Automation.ParameterMetadata
UseDeviceCode          System.Management.Automation.ParameterMetadata
ClientTimeout          System.Management.Automation.ParameterMetadata
Identity               System.Management.Automation.ParameterMetadata
EnvironmentVariable    System.Management.Automation.ParameterMetadata
Break                  System.Management.Automation.ParameterMetadata
Verbose                System.Management.Automation.ParameterMetadata
Debug                  System.Management.Automation.ParameterMetadata
ErrorAction            System.Management.Automation.ParameterMetadata
WarningAction          System.Management.Automation.ParameterMetadata
InformationAction      System.Management.Automation.ParameterMetadata
ErrorVariable          System.Management.Automation.ParameterMetadata
WarningVariable        System.Management.Automation.ParameterMetadata
InformationVariable    System.Management.Automation.ParameterMetadata
OutVariable            System.Management.Automation.ParameterMetadata
OutBuffer              System.Management.Automation.ParameterMetadata
PipelineVariable       System.Management.Automation.ParameterMetadata

When you like it user-friendly. So, you can run the below command:

PS C:\> (Get-Command Connect-Graph).Parameters.Values | Select-Object Name,Aliases,Switchparameter

Name                   Aliases                                                   SwitchParameter
----                   -------                                                   ---------------
Scopes                 {}                                                                  False
ClientId               {AppId, ApplicationId}                                              False
CertificateSubjectName {CertificateSubject, CertificateName}                               False
CertificateThumbprint  {}                                                                  False
Certificate            {}                                                                  False
ClientSecretCredential {SecretCredential, Credential}                                      False
AccessToken            {}                                                                  False
TenantId               {Audience, Tenant}                                                  False
ContextScope           {}                                                                  False
Environment            {EnvironmentName, NationalCloud}                                    False
UseDeviceCode          {UseDeviceAuthentication, DeviceCode, DeviceAuth, Device}            True
ClientTimeout          {}                                                                  False
Identity               {ManagedIdentity, ManagedServiceIdentity, MSI}                       True
EnvironmentVariable    {}                                                                   True
Break                  {}                                                                   True
Verbose                {vb}                                                                 True
Debug                  {db}                                                                 True
ErrorAction            {ea}                                                                False
WarningAction          {wa}                                                                False
InformationAction      {infa}                                                              False
ErrorVariable          {ev}                                                                False
WarningVariable        {wv}                                                                False
InformationVariable    {iv}                                                                False
OutVariable            {ov}                                                                False
OutBuffer              {ob}                                                                False
PipelineVariable       {pv}                                                                False

Get Parameters with Get-Help

You can use the Get-Help cmdlet to get help for PowerShell cmdlets. Using the Get-Help Parameter, you can get the list of all parameters for the cmdlet.

1️⃣ Get-Help with online link a about the cmdlet. After you ran the command, the browser would be opened automatically.

Get-Help Connect-MgGraph -Online
vV2r3E5Z3Q7HbEHg2EAKA6YsPl0CEU0xn1O3lJVmGKz9gKLR7KWTYKUbYR3g

2️⃣ You can run Get-Help with the -ShowWindows parameter. It will open a new window, from here you can filter the information you need.

Get-Help Connect-MgGraph -ShowWindow
3I9WDM42p5mdY6LLDZUGi3jNLHzWg3OFKJ0FdrBg8CzLJPR7QfVyjTJTnKsU

3️⃣ Get-Help can be used to get the examples for the cmdlet.

Get-Help Connect-MgGraph -Examples
PS C:\> Get-Help Get-MgUser -Examples

NAME
    Get-MgUser

SYNOPSIS
    Read properties and relationships of the user object.


    -------------------------- EXAMPLE 1 --------------------------

    PS C:\>Connect-MgGraph -Scopes 'User.Read.All'

    Get-MgUser -All | Format-List  ID, DisplayName, Mail, UserPrincipalName

    Id                : e4e2b110-8d4f-434f-a990-7cd63e23aed6
    DisplayName       : Kristi Laar
    Mail              : [email protected]
    UserPrincipalName : [email protected]

    Id                : dba12422-ac75-486a-a960-cd7cb3f6963f
    DisplayName       : Adele Vance
    Mail              : [email protected]
    UserPrincipalName : [email protected]


    -------------------------- EXAMPLE 2 --------------------------

    PS C:\>Connect-MgGraph -Scopes 'User.Read.All'

    Get-MgUser -UserId 'e4e2b110-8d4f-434f-a990-7cd63e23aed6' |
      Format-List  ID, DisplayName, Mail, UserPrincipalName

    Id                : e4e2b110-8d4f-434f-a990-7cd63e23aed6
    DisplayName       : Kristi Laar
    Mail              : [email protected]
    UserPrincipalName : [email protected]

4️⃣ Show all information about parameters of a cmdlet:

Get-Help Connect-MgGraph -Parameter * | Select-Object Name,Required
#Output

name                   required
----                   --------
AccessToken            true
Break                  false
Certificate            false
CertificateSubjectName false
CertificateThumbprint  false
ClientId               true
ClientSecretCredential false
ClientTimeout          false
ContextScope           false
Environment            false
EnvironmentVariable    false
Identity               false
Scopes                 false
TenantId               false
UseDeviceCode          false

5️⃣ Show all information of a cmdlet:

Get-Help Get-ChildItem -Full

Conclusion

I hope the above article on how to get a list of all available parameters for PowerShell cmdlets using Get-Command and Get-Help cmdlets is helpful to you.

Not a reader? Watch this related video tutorial:

5/5 - (1 vote)
Previous Post

How to Connect to Graph PowerShell with a Client Secret

Next Post

Microsoft Graph Cannot Process Argument Transformation on Parameter ClientSecret

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory