相关疑难解决方法(0)

Powershell Count行非常大的文件

我有一个非常大的文本文件,大小为250 GB,由供应商提供给我们.它们还为我们提供了一个控制文件,该文件应该包含大文件中的行数.有时会出现不匹配的情况.我如何计算Powershell中的线条?我尝试了这个命令,它运行了半个多小时,但还没有完成.

Get-content C:\test.txt | Measure-Object –Line

(gc C:\test.txt | Measure-object | select count).count
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏谢谢MR

powershell performance

3
推荐指数
3
解决办法
488
查看次数

'kubectl patch' works on Linux Bash but not in Windows Powershell ISE

The following command works fine on Ubuntu bash:

kubectl patch deployment wapi-backend-d1 --patch '{"spec": {"template": {"metadata": {"labels": {"date": "test"}}}}}'
Run Code Online (Sandbox Code Playgroud)

The same command does not work in Windows Powershell Console (ISE).

The error is:

kubectl : Error from server (BadRequest): invalid character 's' looking for beginning of object key string
At line:1 char:1
+ kubectl patch deployment wapi-backend-d1 --patch '{"spec": {"template ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error from serv...ject key string:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
Run Code Online (Sandbox Code Playgroud)

The powershell …

syntax powershell parameter-passing quoting kubectl

2
推荐指数
2
解决办法
423
查看次数