Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure Copilot can generate PowerShell scripts that you can use to create or manage resources.
When you tell Azure Copilot about a task you want to perform by using PowerShell, it provides a script with the necessary cmdlets. You'll see which placeholder values that you need to update with the actual values based on your environment.
Tip
You can also get help from Azure Copilot directly from your command-line interface.
Tip
The tasks and sample prompts listed here show a few of the areas where Azure Copilot can be especially helpful. However, this isn't a complete list of all the things you can do. We encourage you to experiment with your own prompts and see how Azure Copilot can help you manage your Azure resources and environment.
Sample prompts
Here are a few examples of the kinds of prompts you can use to generate PowerShell scripts. Some prompts return a single cmdlet, while others provide multiple steps walking through the full scenario. Modify these prompts based on your real-life scenarios, or try additional prompts to create different kinds of queries.
- "How do I list the VMs I have running in Azure using PowerShell?"
- "How can I create a new resource group using PowerShell?"
- "Create a storage account using PowerShell."
- "How do I get all quota limits for a subscription using Azure PowerShell?"
- "Can you show me how to stop all virtual machines in a specific resource group using PowerShell?"
Examples
In this example, the prompt "How do I list all my resource groups using PowerShell?" provides the cmdlet. You can ask follow-up questions to get more information.
You can also ask Azure Copilot for a script with multiple cmdlets. For example, you could say "Write a script for Azure PowerShell that can be run directly to create a VM and then deploy an AKS cluster on it." Azure Copilot provides a code block that you can copy and customize.
Next steps
- Explore capabilities of Azure Copilot.
- Learn more about Azure PowerShell.