powershell - 如何将 cloudformation 参数设置为 powershell 变量
问题描述
尝试根据 cloudformation 中的用户输入参数在我的 cloudformation 中简单地运行一些 powershell。
这有效
write-host ${CFParameter} >> C:\temp\log.txt
但这并不
$PSVariable = ${CFParameter}
write-host $PSVariable >> C:\temp\log.txt
第二个只返回一个空行,但第一个返回正确的信息
解决方案
如果您的 powershell 正在用户数据中使用,您可以使用 ref 函数来引用参数。我建议使用cloudkast,它是一个在线 cloudformation 模板生成器。它使生成 cloudformation 模板变得容易。
推荐阅读
- php - 如何修复 yum install php-mysqli 错误
- c++ - 在链表中添加字符串的简单方法
- polymer - 无法查询 dom 重复中的元素以设置单选按钮默认值
- automation - Automation Anywhere Citrix 插件
- c - 使用 regmap_read() 读取 I2C 寄存器但获取常量值
- php - PHPExcel使用标题名称将excel表上传到数据库
- java - 按下鼠标时检测输入事件javafx
- java - Spring SQS Listener - 启动后立即终止
- java - 似乎无法修复“字段列表”错误中的未知列
- php - 从 Android Studio 的 Mysql 数据库中获取数据