In an effort to attract more .NET developers to the Google Cloud Platform, Google has introduced new tools for Microsoft's PowerShell. The command-line shell and scripting language has been given some new and powerful cmdlets.
Cmdlets are commands that can be used within PowerShell, and the addition allows access and management of Google Cloud Platform resources.
The tools are currently in beta, but let the user utilize the Google Compute Engine, Google Cloud Storage, Google Cloud SQL and Google Cloud DNS. And, according to a Google spokesperson, there's still more to come. In the meantime, users can still use the gcloud command line tool for other services.
Google Cloud Tools for PowerShell Features
According to Google the PowerShell cmdlets allow for a number of tasks, listed below:
- “Google Compute Engine:
- Create a Compute Engine VM instance.
- Start, stop and restart an instance.
- Add or remove a firewall rule.
- Create a disk snapshot.
- Google Cloud Storage:
- Create a storage bucket.
- List all the buckets in the project.
- List the contents of a bucket.
- Get, or delete an item in a bucket.
- Google Cloud DNS:
- Add a zone to Google Cloud Console project.
- Create a ResourceRecordSet.
- Add a record.
- Remove a record.
- Google Cloud SQL
- Add a Cloud SQL instance.
- Import SQL dump files.
- Import CSV files.”
How to Install
Google's PowerShell cmdlets come as part of the Cloud SDK for Windows package. As a result, you'll have to check the PowerShell option on install to gain access to the new cmdlets.
For existing users, the process is a little more complex. You first need to install cmdlets using gcloud by typing “gcloud components install powershell.“
You then have to run the AppendPSModulePath.ps1 script to register the cmdlets with the PowerShell environment. This can be found in: Program Files x86>Google>CloudSDK>google-cloud-sdk>platform>GoogleCloudPowerShell.
You can find more information on how to install and use the new cmdlets on the Google blog post. Let us know what you think in the comments below.