powershell - 使用 powershell 5.1 忽略 write-host -NoNewline 参数
问题描述
从 WMF 5.1 开始,该-NoNewLine
选项Write-Host
基本上被忽略了。
简单的例子:
PS C:\> Write-Host "no newline test " -NoNewline
当前行为:
no newline test
PS C:\>
预期行为
no newline test PS C:\>
PS版表如下:
Name Value
---- -----
PSVersion 5.1.14409.1012
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1012
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
根据 Microsoft docs for powershell 5.1,Next Prompt 应该在Write-Host "no newline test" -NoNewline
语句输出之后出现在同一行中。
知道为什么它没有按预期运行吗?
解决方案
推荐阅读
- javascript - 如何检查哪个选项卡处于活动状态?
- r - 在r中的一页中组合几个ggplot
- java - 围绕原点旋转“细胞”
- node.js - 无法读取未定义的属性“活动”
- java - 如何像在JavaFX中通过的信号一样为线条着色
- web-services - 如何在 OpenEdge Progress4GL 中将 XML 响应转换为临时表?
- amazon-web-services - AWS Glue 爬虫查询
- php - 单击特定图像或文本时在重定向页面中显示相关信息而无需重新加载
- html - 将导航栏按钮填充到容器的宽度
- c# - Unity C# - 如何检查随机移动的游戏对象是否在边界内