A case of PowerShell failure due to improper official translation
Today I saw an article in Powershell.com, is about the application of the GridView, feel very good, decided to try it yourself. But the actual operation of the time has failed, and then began a long row of mistakes.
Http://powershell.com/cs/blogs/tips/archive/2012/01/13/create-own-driver-tool.aspx
First we run, the error is as follows, said "state" this field already exists, what is this ghost?
In the command, a parameter was used
Convertfrom-csv, it will format the data into a CSV style, it is the default "," separate, but it also has a requirement, that is, cannot have the same column appear.
Let's just run it, don't process the data, and see what's going on ...
What the hell are these two "states"?
Find an English version of the machine to run and see what's going on. It turns out that Microsoft has translated state and status.
Here, the state should be a verb, the status is a noun, the other is a difference, but it can be translated into Chinese "status". Although translation can be used, it does not conform to the rules of PowerShell. This article was written in 2012, this year, Microsoft has not found this problem hey. (I think a translation into a state, the second translation into a situation here is more appropriate.) )
Since this has been done, I changed a method in the Chinese environment to execute. As follows:
Add a parameter and give him a subtitle. Of course use Out-file then import-csv also can.
1 |
driverquery.exe/v/fo CSV | Convertfrom-csv-header "module name", "Display Name", "description", "Driver Type", "Startup Mode", "status", "State S", "Accept Stop", "Accept pause", "Paged Pool (bytes)", "Code (bytes)", "BSS (bytes)", "Link Date", "path", "Init (bytes)" |select "module name", "Display Name", "description", "Driver Type", "Startup Mode", "status", "State S", "Accept Stop" | Out-gridview-title "Loaded Master" |
Look at the results, the first line is not what I want, but the rest of the content OK, so the basic still completed the demand.
Microsoft Cloud Solution High-end top group "236804566" to share the achievement of cattle B road
Welcome to Sina Weibo @ Fat nine uncle"Microsoft System Center R2 Private Cloud Deployment" is now availablehttp://www.bkjia.com/PHPjc/1088145.html www.bkjia.com true http://www.bkjia.com/PHPjc/1088145.html techarticle An example of PowerShell failure caused by improper official translation I saw an article in powershell.com today, it is about the application of the GridView, feel very good, decided to try it yourself. But the real ...