使用Start-Process
我可以在我的 powershell 脚本中调用另一个 powershell 脚本。
例如Start-Process powershell -argument '.\Another.ps1
问题是新窗口只有有限的历史记录(即向上滚动查看打印出来的内容)
有什么办法可以增加历史的大小Start-Process
吗?
如果没有,您如何调用另一个可以具有更多历史记录大小的 powershell 脚本?
使用Start-Process
我可以在我的 powershell 脚本中调用另一个 powershell 脚本。
例如Start-Process powershell -argument '.\Another.ps1
问题是新窗口只有有限的历史记录(即向上滚动查看打印出来的内容)
有什么办法可以增加历史的大小Start-Process
吗?
如果没有,您如何调用另一个可以具有更多历史记录大小的 powershell 脚本?
在这种情况下,您可以为该特定会话增加MaximumHistoryCount 。
获取变量 MaximumHistoryCount | Select-Object -ExpandProperty 属性
然后您可以设置最大值。
Set-Variable -Name MaximumHistoryCount -Value 32767
## Check it again using the range also
Get-Variable -Name MaximumHistoryCount | Select-Object -ExpandProperty attributes | Format-List -Property *Range
注意:您不能给出超过32767的值。那是上限。
希望这可以帮助。