小编Zon*_*Out的帖子

Powershell 通过管道将字符串数组传递给 ConvertTo-Html

出于测试目的(在应用我的大代码之前),我决定将一个字符串数组通过管道传递给 ConvertTo-html,希望创建某种显示我的数组的表格。

[String]$servers= @('GT544', 'HT54765', 'J4356', 'SW5654', 'JY67432')
psedit "C:\Users\karljoey.chami\Desktop\Htmltesting\Red.css"
$file = "C:\Users\karljoey.chami\Desktop\Htmltesting\Result.html"
$servers | ConvertTo-Html 
-Title "Servers in a table" -CssUri "C:\Users\karljoey.chami\Desktop\Htmltesting\Red.css" 
-pre "<h>The servers are</h>" | Out-file $file 
Invoke-Item $file
Run Code Online (Sandbox Code Playgroud)

问题是我的字符串数组正在通过管道传递为数组包含的字符数而不是元素本身。

html powershell calculated-field

5
推荐指数
1
解决办法
5926
查看次数

如何同时(并行)在远程计算机上调用-命令相同的功能

我正在编写一个脚本,它有几个函数需要时间在不同的远程计算机上执行。有什么办法可以同时以并行方式调用-命令它们吗?一个例子将不胜感激。谢谢

powershell multithreading

3
推荐指数
1
解决办法
5461
查看次数