Difference between revisions of "Getting Started (AWS PowerShell)"

Jump to navigation Jump to search
Added "Get Instances"
(Added "Set Default Region")
(Added "Get Instances")
 
Line 28: Line 28:
</source>
</source>


== Get Instances ==
Example commands to get instances..
<source lang="PowerShell">
# Get running instances with Production tag
$instances = Get-EC2Instance -Filter @(@{Name="tag:Function";Values="Production"};@{Name="instance-state-name";Values="running"}) | Select-Object -ExpandProperty instances
# Get specific instance
$instance = Get-EC2Instance -Filter @(@{Name="instance-id";Values="i-012345678abcdef01"}) | Select-Object -ExpandProperty instances
</source> 
[[Category: AWS PowerShell]]
[[Category: AWS PowerShell]]

Navigation menu