powershell - `cmdlet Write-Output at command pipeline position 1` 是什么意思?

标签 powershell

我一直在尝试在默认为 powershell 的 visual studio 终端中创建文件,并一直在使用 catecho 来创建新文件,但两者都显示消息:

cmdlet Write-Output at command pipeline position 1
Supply values for the following parameters:

echo 然后请求值:

InputObject[0]:
InputObject[1]:
etc.

鉴于 cat 要求:

Path[0]:
Path[1]:
etc.

这到底是什么意思?

最佳答案

cat(获取内容)有一个强制参数 path,这就是为什么它要求将路径放入您想要的文件,例如

同样的原则适用于 echo(写入输出),因为您告诉它 echo nothing 它会提示您输入一些内容,因此它实际上可以运行命令有意的。

在 powershell 中 [Parameter(Mandatory=$true)] 是您可以用来进一步测试的内容

关于powershell - `cmdlet Write-Output at command pipeline position 1` 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65940433/

相关文章:

powershell - 使用PowerShell清理文件夹

windows - Powershell invoke-webrequest 不工作

powershell - 使用 Get-ADGroup 时隐藏错误

arrays - 在 PowerShell 中选择数组的所有对象的一个​​属性的值

wpf - 如何阻止 Powershell WPF 表单关闭

powershell - 如何以管理员身份并使用批处理文件中的参数运行 PowerShell?

Powershell 一次递归 move 20,000 个文件

powershell - PowerShell-与现有别名的字符串冲突

regex - 使用PowerShell从文本文件中提取表

Azure Functions 内存不足异常