The PowerShell module for Azure Machine Learning is a powerful tool that allows you to use Windows PowerShell to manage workspaces, experiments, datasets, Classic web services, and more.
You can view the documentation and download the module, along with the full source code, at https://aka.ms/amlps.
Note
The Azure Machine Learning PowerShell module is currently in preview mode. The module will continue to be improved and expanded during this preview period. Keep an eye on the Cortana Intelligence and Machine Learning Blog for news and information.
What is the Machine Learning PowerShell module?
The Machine Learning PowerShell module is a .NET-based DLL module that allows you to fully manage Azure Machine Learning workspaces, experiments, datasets, Classic web services, and Classic web service endpoints from Windows PowerShell.
Along with the module, you can download the full source code which includes a cleanly separated C# API layer. You can reference this DLL from your own .NET project and manage Azure Machine Learning through .NET code. In addition, the DLL depends on underlying REST APIs that you can use directly from your favorite client.
What can I do with the PowerShell module?
Here are some of the tasks you can perform with this PowerShell module. Check out the full documentation for these and many more functions.
- Provision a new workspace using a management certificate (New-AmlWorkspace)
- Export and import a JSON file representing an experiment graph (Export-AmlExperimentGraph and Import-AmlExperimentGraph)
- Run an experiment (Start-AmlExperiment)
- Create a web service out of a predictive experiment (New-AmlWebService)
- Create an endpoint on a published web service (Add-AmlWebServiceEndpoint)
- Invoke an RRS and/or BES web service endpoint (Invoke-AmlWebServiceRRSEndpoint and Invoke-AmlWebServicBESEndpoint)
Here's a quick example of using PowerShell to run an existing experiment:
#Find the first Experiment named “xyz”
$exp = (Get-AmlExperiment | where Description -eq ‘xyz’)[0]
#Run the Experiment
Start-AmlExperiment -ExperimentId $exp.ExperimentId
For a more in-depth use case, see this article on using the PowerShell module to automate a commonly-requested task: Create many Machine Learning models and web service endpoints from one experiment using PowerShell.
How do I get started?
To get started with Machine Learning PowerShell, download the release package from GitHub and follow the instructions for installation. The instructions explain how to unblock the downloaded/unzipped DLL and then import it into your PowerShell environment. Most of the cmdlets require that you supply the workspace ID, the workspace authorization token, and the Azure region that the workspace is in. The simplest way to provide the values is through a default config.json file. The instructions also explain how to configure this file.
And if you want, you can clone the git tree, modify the code, and compile it locally using Visual Studio.
Next steps
You can find the full documentation for the PowerShell module at https://aka.ms/amlps.
For an extended example of how to use the module in a real-world scenario, check out the in-depth use case, Create many Machine Learning models and web service endpoints from one experiment using PowerShell.

