powershell - 如果 Get-EC2Tag 命令在变量下,则无法打印结果
问题描述
$instanceId = (New-Object System.Net.WebClient).DownloadString(" http://169.254.169.254/latest/meta-data/instance-id" )
$tag = Get-EC2Tag -Filter @{Name="resource-type";Value="instance"},@{Name="key";Value="Name"} | Where-Object ResourceId -eq $instanceId | 选择对象值 | Format-Table -HideTableHeaders Write-Host $tag
解决方案
这是 Write-Host $tag 的结果
Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData Microsoft.PowerShell.Commands。 Internal.Format.FormatEndData
推荐阅读
- java - 在 JTable 中选择一行时,JButton 未重新启用
- laravel - 如何在项目文件夹 Php Laravel 之外上传图片?
- javascript - “shadowRoot.querySelector”不适用于 Web 组件中的 lit-element
- django - Docker 中的数据库 Postgres 与 Django?
- java - 用java设计一个客户端/服务器系统(TCP),它由一个服务器和一组客户端程序组成
- html - 转义固定宽度的 CSS 列
- c# - Kestrel 向 HttpContext 返回空响应
- python - 在 Python 中将文本文件的内容读入字典
- angular - 弹性搜索:无法检索昨天和今天的记录
- attributes - DXL 问题:如何列出模块中的所有属性名称