A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/powershell/latest/reference/items/Start-EC2Instance.html below:

EC2: Start-EC2Instance Cmdlet | AWS Tools for PowerShell

Example 1

Start-EC2Instance -InstanceId i-12345678

CurrentState InstanceId PreviousState

------------ ---------- -------------

Amazon.EC2.Model.InstanceState i-12345678 Amazon.EC2.Model.InstanceState

This example starts the specified instance.

Example 2

@("i-12345678", "i-76543210") | Start-EC2Instance

This example starts the specified instances.

Example 3

(Get-EC2Instance -Filter @{ Name="instance-state-name"; Values="stopped"}).Instances | Start-EC2Instance

This example starts the set of instances that are currently stopped. The Instance objects returned by Get-EC2Instance are piped to Start-EC2Instance. The syntax used by this example requires PowerShell version 3 or higher.

Example 4

$filter = New-Object Amazon.EC2.Model.Filter

$filter.Name = "instance-state-name"

$filter.Values = "stopped"

(Get-EC2Instance -Filter $filter).Instances | Start-EC2Instance

With PowerShell version 2, you must use New-Object to create the filter for the Filter parameter.

Example 5

Start-EC2Instance -InstanceId 'i-0abcdef123456' -Region 'us-west-1' -DryRun $true

This example validates permissions for starting an EC2 instance using the DryRun parameter without actually starting the instance. Note: This throws an exception if succeeded which is the expected behavior.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4