Home >Backend Development >PHP Tutorial >An example of PowerShell failure due to improper official translation_PHP Tutorial

An example of PowerShell failure due to improper official translation_PHP Tutorial

WBOY
WBOYOriginal
2016-07-12 09:01:48966browse

A case of PowerShell failure caused by improper official translation

Today I saw an article on PowerShell.com about the application of Gridview. I thought it was pretty good and decided to try it myself. . But it failed in actual operation, and then a long troubleshooting process began.

http://powershell.com/cs/blogs/tips/archive/2012/01/13/create-own-driver-tool.aspx

First, let’s run it. The error is as follows, saying that the field "Status" already exists. What the hell is this?

In the command, a parameter

ConvertFrom-Csv is used, which will format the data into csv style, which is the default "," Separate, but it also has a requirement, that is, the same columns cannot appear.

Let’s run it directly without processing the data to see what’s going on...

What the hell are these two "states"?

Find an English version of the machine and run it to see what is going on. It turns out that Microsoft translated both state and status into status.

Here, state should be a verb and status is a noun. There is still a difference between them, but they can indeed be translated into Chinese "status". Although the translation works, it does not comply with the rules of PowerShell. This article was written in 2012. This year, Microsoft has not discovered this problem. (I think one translated as status and the second translated as situation is more appropriate here.)

Now that this is the case, I Changed the method to execute in Chinese environment. As follows:

means adding a parameter and giving it a subtitle. Of course, you can also use out-file and then import-csv.

1 Driverquery.exe /v /FO CSV |Convertfrom-csv -Header "模块名","显示名称","描述","驱动程序类型","启动模式","状态","状态s","接受停止","接受暂停","分页池(字节)","代码(字节)","BSS(字节)","链接日期","路径","Init(字节)"|select "模块名","显示名称","描述","驱动程序类型","启动模式","状态","状态s","接受停止"|Out-GridView -title "装逼大师"

Looking at the results, the first line is not what I want, but the rest of the content is OK, so the requirements are basically fulfilled.

Microsoft cloud solution high-end top group [236804566] shares the road to becoming a great player


Welcome to follow Sina Weibo @飞九书
  • "Microsoft System Center 2012 R2 Private Cloud Deployment Practice" is now available
  • www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1088145.htmlTechArticleAn example of PowerShell failure caused by improper official translation. Today I saw an article on PowerShell.com about Gridview I thought it was a good application and decided to try it myself. But in reality...
    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn