小编Idr*_*ala的帖子

使用aws cli获取最新的Windows 2012R2基本AMI ID?

有没有办法使用aws cli获取最新的Windows 2012R2基础AMI ID?

类似Get-EC2ImageByName -Names WINDOWS_2012R2_BASEPowershell的东西.我想在Linux中使用它.

我尝试过使用AMI id, aws ec2 describe-images --owners amazon --filters "Name=name,Values=Windows_Server-2012-R2_RTM-English-64Bit-Base-*"但感觉就像是黑客.在Powershell中有更好的方法吗?

amazon-web-services aws-cli aws-powershell amazon-ami

4
推荐指数
1
解决办法
730
查看次数

-replace不会用"()"替换字符串

我正在尝试在PowerShell中替换包含括号的字符串.但是,当我尝试这样做时,它无法正常工作.

知道我哪里出错了吗?什么是我该做的更换包含字符串()-replace在PowerShell中?

$a='Some Text with (round) brackets. This text is long.'
$ch="with (round) brackets."
$b="this text"
$a -replace $ch,$b
Run Code Online (Sandbox Code Playgroud)

输出:

Some Text with (round) brackets. This text is long.
Run Code Online (Sandbox Code Playgroud)

powershell

2
推荐指数
1
解决办法
2202
查看次数