问题描述
命令:
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位计算机,安装了所有内容以到达此处并停止了我不知道如何解决的错误
解决方法
该错误意味着Get-Content
(作为cmdlet cat
的别名)不理解要求执行的操作。
docs提供了示例和语法。如果传递单个字符串,该字符串将被解释为文件名,因为参数位置零与-path
相同。由于没有其他定位参数,因此该cmdlet无法理解kernel.bin
应该是什么。
如果您想容纳多个文件,则像这样将文件名作为数组传递,
cat file1,file2 > otherfile
或使用变量
$myFiles = gci <somepath>
cat $myFiles > otherfile