对于Get-Random,如何获得随机数并使结果看起来像这样?
'100,100'
最佳答案
您需要使用-Count
参数。不幸的是,您将需要通过管道为它提供最小/最大。
# String
(1..100 | Get-Random -Count 2) -join ','
# Array
1..100 | Get-Random -Count 2
可以在MS Page上找到有关
Get-Random
的更多详细信息。
关于powershell - Powershell:获取两个随机的独立数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59761873/