powershell - Powershell Get-TransportRule 读取传输规则属性的完整数据
问题描述
Get-TransportRule "Gmail Block" | Select-Object "ExceptIfFrom" | Format-List
返回结果
ExceptIfFrom : {terer.nolt@gmail.com, calendar-notification@google.com, brianqfaanur@gmail.com, cced1rley657@gmail.com...}
我将如何请求整个列表?
解决方案
更新$formatenumerationlimit
为等于或大于您的集合大小的值:
# -1 is unlimited
$formatenumerationlimit = -1
当对象的属性值是一个集合并且您正在使用显示属性/值对的视图时,$formatenumerationlimit
自动变量会确定集合中的多少项在被截断之前是可见的。默认值为4
。
您可以使用简单的对象轻松复制这种情况:
$obj = [pscustomobject]@{property = 1,2,3,4,5,6,7,8,9}
$obj
输出:
property
--------
{1, 2, 3, 4...}
现在更新$formatenumerationlimit
$formatenumerationlimit = 9
$obj
$formatenumerationlimit = -1
$obj
输出:
property
--------
{1, 2, 3, 4, 5, 6, 7, 8, 9}
property
--------
{1, 2, 3, 4, 5, 6, 7, 8, 9}
或者,仅检索属性的值可能会显示所有列表项,并且不受$formatenumerationlimit
.
$obj.property
$obj | Select-Object -ExpandProperty property
输出:
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
推荐阅读
- firefox - Firefox 上的 gwt onMouseOver 和 onMouseOut
- r - r blogdown - build_site 结果与serve_site 的预览不匹配
- python - 指定 EMAIL_FILE_PATH 和 render_to_string
- mysql - 将有符号转换为无符号整数列
- arrays - 为什么我的 MIPS 运行我的代码会冻结火星模拟器?
- reactjs - 使用 TypeScript 的上下文提供程序的范围问题
- apache - .htaccess 两个域重定向到一个 ssl 域
- python - 当我向我的数据框添加新列时,它显示为 NaN
- python - Pandas 可以使用 Concat 处理大型 CSV 文件吗?- 合并 CSV 文件
- flutter - 颤动中的大小框内的文本