Skip to main content

Cloud Shell

Enterprise

Synopsis​

Cloud Shell is a PowerShell console inside the DataStream web interface. It runs the cmdlets of the VirtualMetric PowerShell module in your browser, signed in as you, with nothing to install and no separate sign-in.

Cloud Shell knows only the VirtualMetric cmdlets and a small set of PowerShell built-ins. It is a place to query and change your fleet, not a general-purpose shell.

Like PowerShell itself, Cloud Shell works through the REST API. It needs a plan that includes REST API access.

Opening Cloud Shell​

Click the Cloud Shell button, a terminal icon, in the header. It is hidden when the header is compact. There is no keyboard shortcut for it.

Cloud Shell opens as a panel docked along the bottom of the page. Drag its top edge to resize it. The panel's title bar shows the tenant and your email address, and has three buttons:

  • Switch tenant — opens the tenant picker. Shown only when you can open more than one tenant.
  • Restart Cloud Shell — starts a fresh console.
  • Close Cloud Shell — closes the panel and ends its session.

While the panel is open, the page keeps its own bottom content reachable above it. The panel still sits over the page, but the page reserves the panel's height, so nothing is hidden underneath.

Choosing a Tenant​

Cloud Shell signs in to one tenant at a time, as you, with your permissions there. The Choose a tenant dialog lists the tenants you can open, with your current one marked (current). Pick one and click Open Cloud Shell.

To change tenants later, use Switch tenant on the panel, or run Set-VMetricContext -Tenant <name>.

When the console connects, it prints a banner naming the tenant and your account, and suggests Get-Command and Get-Help <cmdlet>.

Plans Without REST API Access​

On a plan without REST API access, the panel shows the upgrade prompt, Automate VirtualMetric with the REST API, instead of a console.

Using the Console​

KeyAction
EnterRuns the command
Shift+EnterStarts a new line
Up / DownRecalls earlier commands
TabCompletes
Ctrl+CStops a running command
Ctrl+LClears the console
Escape, then TabLeaves the console, moving focus back to the page

Syntax highlighting. The command line is highlighted as you type. A command Cloud Shell cannot run is marked as unsupported before you run it.

Tab completion. Tab completes anywhere in the line: command names, including after |, ;, ( or =, parameter names, the values a parameter accepts, and variables. It also completes resource values from the resource's own list. -Name <Tab> completes the tenant's names, and -Id <Tab> completes ids. Tab after -Field lists the fields that parameter can change. The first Tab on a resource value may return nothing while the list is fetched; the values appear on the next Tab.

Output. Output follows PowerShell 7's style. Table and list headers are set apart in PowerShell 7's green, and ConvertTo-Json output is coloured: keys, strings, numbers and keywords each have their own colour.

Get-VMetricDevice | Where-Object protocol -eq udp | Format-Table name, port, status
Set-VMetricDevice fortigate-syslog -Field framing -Value rfc6587 -WhatIf
Get-VMetricDirector | Get-VMetricDirectorHealth | Format-Table name, stateName, cpuPct, memPct
Test-VMetricPipeline fw_syslog

Every cmdlet works as it does in the module, including -Status, -Field and -Value on Set, the health cmdlets, Get-VMetricPipelineTest and Test-VMetricPipeline, and Get-VMetricSearchSource and Invoke-VMetricSearch. See PowerShell for the cmdlets and their parameters.

What Is Available​

Cloud Shell runs:

  • every cmdlet of the VirtualMetric module
  • pipelines, variables, if and foreach, as in PowerShell
  • common built-ins and their aliases: Where-Object (?, where), ForEach-Object (%, foreach), Select-Object, Sort-Object, Group-Object, Measure-Object, Format-Table (ft), Format-List (fl), Write-Output (echo, write), Get-Command (gcm), Get-Help (help, man), Get-History (h, history), and Clear-Host (cls, clear)

It does not run:

  • scripts or functions, and keywords such as function, while, for, switch, try, param, return and exit
  • .NET types, method calls, and operators such as -replace, -split, -join and -f
  • other modules: nothing can be imported
  • the file system, apart from uploading and downloading files

A command that is not available reports '<name>' is not available in Cloud Shell.

Uploading and Downloading Files​

Cloud Shell has no file system of its own, so files go through your browser:

  • Upload. -TemplateFile and -TemplateParameterFile on New-VMetricDeployment and Test-VMetricDeployment open the browser's file picker. Click Choose file. The file is read in your browser, never stored, and can be up to 5 MB.
  • Download. Out-File and Export-VMetricTemplate -Path download the result as a file in your browser.

-AsJob on New-VMetricDeployment is not available.

Connect-VMetric and Disconnect-VMetric​

Cloud Shell is already signed in with your console session. Connect-VMetric accepts -Uri and -Environment and ignores them, because the shell always works in the console it was opened in. Use -Tenant, or Set-VMetricContext -Tenant, to switch tenants. -ApiToken is not available.

Disconnect-VMetric does not sign out. Close the panel to end the session.

The Cloud Shell Session​

Cloud Shell signs in with a session minted from your console sign-in. It acts as you, with your role and your access to the tenant, exactly as a PowerShell sign-in does. The session appears under PowerShell sessions in Account Settings as a Cloud Shell session.

The session ends when:

  • you close the panel
  • you sign out of the console, or your console sign-in ends otherwise
  • you revoke it from Account Settings

When the console sign-in has ended, Cloud Shell stops and asks you to sign in to the console again, then open Cloud Shell.

Audit​

Everything Cloud Shell does is recorded in the audit log:

  • Opening Cloud Shell writes a CliSessionCreated row, and ending its session early a CliSessionRevoked row.
  • Every command you run writes a CliCommandExecuted row, with the command line and its outcome: completed, failed, refused, invalid or cancelled. Secret values in the command line are masked as ***. The row's detail view shows the command.
  • A change a command makes is recorded as the console would record it, with cloudshell as the client.

A pipeline commit made from Cloud Shell carries an API · Cloud Shell tag in the pipeline's commit history.