繁体   English   中英

Powershell启动过程以运行具有更多历史记录的另一个Powershell脚本

[英]Powershell Start-Process to run another Powershell script with more history

使用Start-Process我可以在我的powershell脚本中调用另一个powershell脚本。

例如, Start-Process powershell -argument '.\\Another.ps1

问题是新窗口仅具有有限的历史记录(即,向上滚动以查看打印的内容)

有什么办法可以从Start-Process增加历史记录的大小?

如果不是,您如何调用另一个具有更大历史记录大小的powershell脚本?

在这种情况下,您可以为该特定会话增加MaximumHistoryCount

Get-Variable MaximumHistoryCount | 选择对象-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的值。 那是上限。

希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM