---
title: "Your Getting Started Guide to PowerShell Approved Verbs"
description: "Discover how to get started with PowerShell Approved Verbs to make sure your scripts and code is top-notch in this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/powershell-approved-verbs/"
---

# Your Getting Started Guide to PowerShell Approved Verbs

> Discover how to get started with PowerShell Approved Verbs to make sure your scripts and code is top-notch in this ATA Learning tutorial!

Source: https://adamtheautomator.com/powershell-approved-verbs/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Your Getting Started Guide to PowerShell Approved Verbs](https://adamtheautomator.com/wp-content/uploads/2023/08/powershell-approved-verbs.jpg)

# Your Getting Started Guide to PowerShell Approved Verbs

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)8 August 20235 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)[PowerShell Language](/tag/powershell-language/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Retrieving a List of PowerShell Approved Verbs](#retrieving-a-list-of-powershell-approved-verbs)
*   [Creating New Resources via the New Verb](#creating-new-resources-via-the-new-verb)
*   [Retrieving Resource Information via the Get Verb](#retrieving-resource-information-via-the-get-verb)
*   [Modifying Existing Resources via the Set Verb](#modifying-existing-resources-via-the-set-verb)
*   [Triggering Actions or Invoking Commands via the Invoke Verb](#triggering-actions-or-invoking-commands-via-the-invoke-verb)
*   [Validating Resources via the Test Verb](#validating-resources-via-thetest-verb)
*   [Conclusion](#conclusion)

When it comes to PowerShell scripting, consistent naming conventions make the task of building robust solutions much easier. The good news is that there are PowerShell approved verbs you can use when writing scripts and commands.

In this tutorial, you will learn which approved verbs to use in PowerShell through a series of examples.

Jump right in and level up your PowerShell scripting!

## Prerequisites

This tutorial comprises hands-on demonstrations. If you wish to follow along, ensure you have a system running PowerShell 5.1 or later. This tutorial uses Windows 11 with PowerShell 7.

Related:[PowerShell 7 Upgrade : A How to Walk Through](https://adamtheautomator.com/powershell-7-upgrade/)

## Retrieving a List of PowerShell Approved Verbs

In PowerShell, cmdlets are small, single-function commands that perform specific actions in the PowerShell environment.

Each cmdlet in [PowerShell](https://adamtheautomator.com/basic-powershell-commands/) has a unique name that follows a verb-noun pair format where:

*   The verb part of the name describes the action that the cmdlet performs. Some common verbs used in PowerShell are as follows:

| Verb | Function |
| --- | --- |
| `Get` | Retrieves information. |
| `Set` | Changes or updates settings. |
| `New` | Creates something new. |
| `Remove` | Deletes or removes something. |

*   The noun part of the name identifies the entity or object on which the action is performed, the target to take action upon. The noun typically describes the category or type of object the cmdlet interacts with, such as command, process, service, or file.

Related:[The 10 Basic PowerShell Commands You Need to Know](https://adamtheautomator.com/basic-powershell-commands/)

To see all approved verbs you can use for your script:

Execute the following `Get-Verb` cmdlet to get a complete list of PowerShell-approved verbs.

```powershell
Get-Verb
```

The output below shows just a few verbs you can use for your script.

![powershell approved verbs - Retrieving a complete list of approved verbs](https://adamtheautomator.com/wp-content/uploads/2023/08/image-42.png)

Retrieving a complete list of approved verbs

Now, run the same command as below, but this time, you will list all approved verbs that start with `re` via a wildcard search. Doing so narrows down the list of verbs to those associated with reset, resize, redo, and so on.

```powershell
Get-Verb re*
```

As shown below, narrowing down the list of verbs can be helpful when you have a specific action in mind and wish to find a verb that closely matches that action.

![Narrowing down the list of approved verbs](https://adamtheautomator.com/wp-content/uploads/2023/08/image-41.png)

Narrowing down the list of approved verbs

## Creating New Resources via the `New` Verb

You have just retrieved a list of approved verbs in PowerShell, but how do you use those verbs in your script or when running commands? You will prepend the `New` verb to a noun representing the type of resource you wish to create (i.e., user, file, service).

But in this example, you will create a new resource, specifically a new user, as follows:

Execute the following `New-LocalUser` command to create a new user called `John Smith` with a password (`Password123`) and set the account never to expire (`-AccountNeverExpires`).

```powershell
New-LocalUser -Name "John Smith" -AccountNeverExpires -Password (ConvertTo-SecureString -AsPlainText "Password123" -Force
```

![Creating a new resource (user account) via the New verb](https://adamtheautomator.com/wp-content/uploads/2023/08/image-51.png)

Creating a new resource (user account) via the New verb

Related:[Adding a Windows 10 Local Account : Step by Step Guide](https://adamtheautomator.com/add-windows-10-local-account/)

## Retrieving Resource Information via the `Get` Verb

Besides creating new resources, PowerShell also has a verb that lets you retrieve information about any of your existing resources. In PowerShell, the `Get` verb is commonly used to retrieve or fetch information about a particular resource, such as the OS, services, files, and other objects.

To retrieve resource information via the `Get` verb:

Run the `Get-LocalUser` command below to get information about a specific local user (`John Smith`).

```powershell
Get-LocalUser -Name "John Smith"
```

Below, the output shows the user account **John Smith** is **Enabled** (active).

![Retrieving resource information via the Get verb](https://adamtheautomator.com/wp-content/uploads/2023/08/image-44.png)

Retrieving resource information via the `Get` verb

## Modifying Existing Resources via the `Set` Verb

Imagine you noticed something was off after seeing one of your resource’s information. How can you modify an existing resource? Worry not! A PowerShell-approved verb, the `Set` verb, allows you to make changes to existing resources.

Instead of recreating resources, the `Set` verb lets you adjust by modifying their properties or configurations.

To modify existing resources via the `Set` verb:

Execute the below commands to set the value of `$myVariable` to `Hello` and modify the value of `$myVariable` to `Hello, World!`. These commands do not provide output, but you will verify the changes in the following step.

Related:[PowerShell Environment Variables: The Ultimate Guide](https://adamtheautomator.com/powershell-environment-variables/)

```powershell
# Define a variable resource
$myVariable = "Hello"

# Modify the value of an existing variable resource
Set-Variable -Name myVariable -Value "Hello, World!"
```

Now, run the `Get-Variable` command below to retrieve information about your resource (`$myVariable`).

```powershell
Get-Variable -Name myVariable
```

As shown below, the output shows the variable’s name and value.

![Retrieving information about a resource](https://adamtheautomator.com/wp-content/uploads/2023/08/image-45.png)

Retrieving information about a resource

## Triggering Actions or Invoking Commands via the `Invoke` Verb

Instead of manually running commands, as you did in the previous examples, why not automate them in a PowerShell script? How? The `Invoke` verb allows you to initiate actions or invoke commands programmatically.

With a PowerShell script and the `Invoke` verb, you can run multiple PowerShell commands at once without typing them all in the console.

To see how triggering actions work via the `Invoke` verb:

1\. Execute the following `Invoke-Expression` command to invoke the `Get-Date` command, which lets you retrieve the current date and time.

Related:[The Practical PowerShell Get Date to Demystify Date and Time](https://adamtheautomator.com/powershell-get-date/)

```powershell
Invoke-Expression -Command "Get-Date"
```

The output below shows a successful execution of the `Get-Date` command via the `Invoke` verb.

![Triggering a command via the Invoke verb](https://adamtheautomator.com/wp-content/uploads/2023/08/image-49.png)

Triggering a command via the `Invoke` verb

2\. Next, create a PowerShell script file (i.e., _InvokeVerbDemo.ps1_) with your preferred code editor, and populate the following code.

This code displays ([`Write-Host`](https://adamtheautomator.com/powershell-write-host/)) a welcome message and invokes the `Get-Service` cmdlet to list all services in your system.

```powershell
# Display a warm welcome message
Write-Host "Welcome to the Invoke Example!"

# Invoke the Get-Service cmdlet
Invoke-Command -ScriptBlock { Get-Service }
```

3\. Now, run the following commands to invoke (`Invoke-Expression`) your PowerShell script (`InvokeVerbDemo.ps1`). Replace the `$scriptPath` variable’s value with your script file’s path.

```powershell
$scriptPath = "C:\PowerShellScripts\InvokeVerbDemo.ps1"
Invoke-Expression -Command $scriptPath
```

Related:[How to Run a PowerShell Script From the Command Line and More](https://adamtheautomator.com/run-powershell-script/)

The output below shows a welcome message and a list of all services in your system, which confirms a successful execution of your script.

![Invoking a script via the Invoke verb](https://adamtheautomator.com/wp-content/uploads/2023/08/image-48.png)

Invoking a script via the `Invoke` verb

4\. Instead of just commands, write a reusable function (i.e., `Invoke-MyTask`) that you can call at any time, as shown below. Essentially, functions enhance the maintainability and reusability of your PowerShell scripts.

Related:[Your Getting Started Guide to Powershell Functions](https://adamtheautomator.com/powershell-functions/)

In this example, the `Invoke-MyTask` function encapsulates commands to perform the following when invoked:

*   Displays (`Write-Host`) the string `Executing MyTask...` on the console.
*   Retrieves the list of all processes (`Get-Process`) and selects only (`Select-Object`) the `Name` and `CPU` properties for each process.

Related:[Steamy PowerShell Get-Process Cmdlet for Running Processes](https://adamtheautomator.com/powershell-get-process/)

Related:[PowerShell Select-Object Made Simple: A Beginner’s Guide](https://adamtheautomator.com/powershell-select-object/)

```powershell
# Define a custom function using the Invoke verb
function Invoke-MyTask {
    # Your custom task goes here
    Write-Host "Executing MyTask..."
    Get-Process | Select-Object Name, CPU
}
```

![Defining a PowerShell function](https://adamtheautomator.com/wp-content/uploads/2023/08/image-47.png)

Defining a PowerShell function

5\. Lastly, execute the below command to invoke your function (`Invoke-MyTask`).

```powershell
Invoke-Expression -Command Invoke-MyTask
```

You will see a list of all processes running on your system with their names and CPU usage, as shown below.

![Invoking a function](https://adamtheautomator.com/wp-content/uploads/2023/08/image-46.png)

Invoking a function

## Validating Resources via the `Test` Verb

Ensuring the accuracy of input values and conditions is paramount when crafting robust and error-resistant PowerShell scripts. One powerful tool at your disposal for this purpose is the `Test` verb.

By employing the `Test` verb, you can quickly verify whether a given condition holds a true or false value, enabling you to execute different actions based on the outcome. In this example, you will validate if a file exists via the `Test` verb.

Execute the code below to test ([`Test-Path`](https://adamtheautomator.com/powershell-test-path/)) whether a file exists (`C:\MyFolder\example.txt`) at the specified `$filePath`, and print a message depending on the result.

Related:[Validate PowerShell to Check if a File Exists (Examples)](https://adamtheautomator.com/powershell-check-if-file-exists/)

```powershell
# Define a file path.
$filePath = "C:\MyFolder\example.txt"

# Test if the file exists, and print a message depending on the result
if (Test-Path $filePath) {
    Write-Host "The file exists at $filePath."
}
else {
    Write-Host "The file does not exist at $filePath."
}
```

![Validating a resource via the Test verb](https://adamtheautomator.com/wp-content/uploads/2023/08/image-50.png)

Validating a resource via the `Test` verb

## Conclusion

You now have a basic understanding of PowerShell-approved verbs and how to use them effectively in your scripts and commands. By leveraging these verbs, you can now create robust, efficient, and consistent PowerShell solutions for various tasks and scenarios.

This tutorial is just the beginning of your journey to becoming a proficient PowerShell user. Why not learn other approved verbs, such as [data manipulation verbs](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands?view=powershell-7.3#data-verbs) (i.e., `Export`, `Import`, `Sort`) and [lifecycle verbs](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands?view=powershell-7.3#lifecycle-verbs) (i.e., `Start`, `Stop`)? Take your PowerShell skills to the next level today!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-approved-verbs%2F&text=Your%20Getting%20Started%20Guide%20to%20PowerShell%20Approved%20Verbs)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-approved-verbs%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-approved-verbs%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2023/07/powershell-sort-object.jpg)

### [Learning PowerShell Sort-Object with Examples](/powershell-sort-object/)

Learn all of the ins-and-outs of the PowerShell Sort-Object cmdlet in this example driven tutorial by ATA Learning!

![](https://adamtheautomator.com/wp-content/uploads/2023/03/powershell-change-directory.jpg)

### [PowerShell Change Directory: Navigating Your File System](/powershell-change-directory/)

Learn how to use the PowerShell change directory command to navigate your file system with ease. Master the basics of PowerShell file navigation today.

![](https://adamtheautomator.com/wp-content/uploads/2023/02/powershell-write-output.jpg)

### [PowerShell Write-Output: Your Friendly Output Companion](/powershell-write-output/)

Learn all of the ins and outs of the PowerShell Write-Output cmdlet and take control of script and object output in this ATA Learning tutorial!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
