无法找到接受“ kernel.bin”的位置参数

时间:2020-09-11 22:54:01

标签: powershell cat

命令:

cat bootsect.bin kernel.bin > os-image.bin

错误:

Get-Content : It is not possible to find a positional parameter that accepts the 'kernel.bin' argument.
No linha:1 caractere:1
+ cat bootsect.bin kernel.bin > os-image.bin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

我该如何解决?

我正在使用10台Wins 64位计算机,安装了所有内容以到达此处并停止了我不知道如何解决的错误

1 个答案:

答案 0 :(得分:0)

该错误意味着Get-Content(作为cmdlet cat的别名)不理解要求执行的操作。

docs提供了示例和语法。如果传递单个字符串,该字符串将被解释为文件名,因为参数位置零与-path相同。由于没有其他定位参数,因此该cmdlet无法理解kernel.bin应该是什么。

如果您想容纳多个文件,则像这样将文件名作为数组传递,

cat file1,file2 > otherfile

或使用变量

$myFiles = gci <somepath>
cat $myFiles > otherfile
相关问题