繁体   English   中英

有没有人有启动和停止 aws ec2 实例的 PowerShell 脚本

[英]Does anyone have a PowerShell script that starts and stops aws ec2 instances

有没有人有启动和停止 aws ec2 实例的 PowerShell 脚本?

参数 ( [字符串] $Filter = "xxxxx*" )

$CurrentDate = (Get-Date -Format "yyyyMMdd.0.0")

$instances = Get-EC2Instance -Filter @(@{name = 'tag:Name'; values = "xxxx"}) Start-EC2Instance $_.instances.instanceid

查看 AWS 提供的此 cmdlet:“Start-EC2Instance Cmdlet”, https://docs.aws.amazon.com/powershell/latest/reference/items/Start-EC2Instance.html

此外,请查看 PowerShell Gallery 以了解 PowerShell 的 AWS 工具: https://www.powershellgallery.com/packages/AWS.NetCore/。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM