Change locale of mdspell to en-US (#7671)
Update the locale to use en-us for mdspell checker.
This commit is contained in:
parent
137d5de82b
commit
994abcc9d1
|
@ -48,7 +48,7 @@ script:
|
|||
# spellcheck
|
||||
# Ignore 'Pester' folder because it's third party
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||
mdspell '**/*.md' '!**/Pester/**/*.md' --ignore-numbers --ignore-acronyms --report;
|
||||
mdspell '**/*.md' '!**/Pester/**/*.md' --ignore-numbers --ignore-acronyms --report --en-us;
|
||||
fi
|
||||
|
||||
after_failure:
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
PowerShell Beginner’s Guide
|
||||
====
|
||||
# PowerShell Beginner’s Guide
|
||||
|
||||
If you are new to PowerShell, this document will walk you through a few examples to give you some basic ideas of PowerShell.
|
||||
We recommend that you open a PowerShell console/session and type along with the instructions in this document to get most out of this exercise.
|
||||
|
||||
## Launch PowerShell Console/Session
|
||||
|
||||
Launch PowerShell Console/Session
|
||||
---
|
||||
First you need to launch a PowerShell session by following the [Installing PowerShell Guide](./README.md#installing-powershell).
|
||||
|
||||
## Getting Familiar with PowerShell Commands
|
||||
|
||||
Getting Familiar with PowerShell Commands
|
||||
---
|
||||
In this section, you will learn how to
|
||||
|
||||
- create a file, delete a file and change file directory
|
||||
- discover what version of PowerShell you are currently using
|
||||
- exit a PowerShell session
|
||||
|
@ -29,6 +27,7 @@ It is shown as **PS C:\\>** on Windows.
|
|||
**1. Get-Process**: Gets the processes that are running on the local computer or a remote computer.
|
||||
|
||||
By default, you will get data back similar to the following:
|
||||
|
||||
``` PowerShell
|
||||
PS /> Get-Process
|
||||
|
||||
|
@ -41,8 +40,10 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
|
|||
|
||||
…
|
||||
```
|
||||
|
||||
Only interested in the instance of firefox process that are running on your computer?
|
||||
Try this:
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Process -Name firefox
|
||||
|
||||
|
@ -51,8 +52,10 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
|
|||
- - - 74 403.150 1209 firefox
|
||||
|
||||
```
|
||||
|
||||
Want to get back more than one process?
|
||||
Then just specify process names and separate them with commas.
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Process -Name firefox, powershell
|
||||
Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
|
||||
|
@ -63,14 +66,17 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
|
|||
```
|
||||
|
||||
**2. Clear-Host**: Clears the display in the host program.
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Process
|
||||
PS /> Clear-Host
|
||||
```
|
||||
|
||||
Type too much just for clearing the screen?
|
||||
Here is how the alias can help.
|
||||
|
||||
**3. Get-Alias**: Gets the aliases for the current session.
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Alias
|
||||
|
||||
|
@ -94,11 +100,14 @@ Now try it:
|
|||
PS /> Get-Process
|
||||
PS /> cls
|
||||
```
|
||||
|
||||
**4. cd - Set-Location**: Sets the current working location to a specified location.
|
||||
|
||||
```PowerShell
|
||||
PS /> Set-Location /home
|
||||
PS /home>
|
||||
```
|
||||
|
||||
**5. dir - Get-ChildItem**: Gets the items and child items in one or more specified locations.
|
||||
|
||||
```PowerShell
|
||||
|
@ -130,6 +139,7 @@ Mode LastWriteTime Length Name
|
|||
---- ------------- ------ ----
|
||||
-a---- 7/7/2016 7:17 PM 0 test.txt
|
||||
```
|
||||
|
||||
You can use the **-Value** parameter to add some data to your file.
|
||||
For example, the following command adds the phrase "Hello world!" as a file content to the test.txt.
|
||||
Because the test.txt file exists already, we use **-Force** parameter to replace the existing content.
|
||||
|
@ -145,21 +155,25 @@ Mode LastWriteTime Length Name
|
|||
-a---- 7/7/2016 7:19 PM 24 test.txt
|
||||
|
||||
```
|
||||
|
||||
There are other ways to add some data to a file.
|
||||
For example, you can use Set-Content to set the file contents:
|
||||
|
||||
```PowerShell
|
||||
PS /home/jen>Set-Content -Path ./test.txt -Value "Hello world again!"
|
||||
```
|
||||
|
||||
Or simply use ">" as below:
|
||||
```
|
||||
|
||||
```powershell
|
||||
# create an empty file
|
||||
"" > test.txt
|
||||
"" > test.txt
|
||||
|
||||
# set "Hello world!" as content of test.txt file
|
||||
"Hello world!!!" > test.txt
|
||||
|
||||
```
|
||||
|
||||
The pound sign (#) above is used for comments in PowerShell.
|
||||
|
||||
**7. type - Get-Content**: Gets the content of the item at the specified location.
|
||||
|
@ -170,9 +184,11 @@ PS /home/jen> type -Path ./test.txt
|
|||
|
||||
Hello world again!
|
||||
```
|
||||
|
||||
**8. del - Remove-Item**: Deletes the specified items.
|
||||
|
||||
This cmdlet will delete the file /home/jen/test.txt:
|
||||
|
||||
```PowerShell
|
||||
PS /home/jen> Remove-Item ./test.txt
|
||||
```
|
||||
|
@ -190,7 +206,7 @@ PSEdition Core
|
|||
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
|
||||
BuildVersion 3.0.0.0
|
||||
GitCommitId v6.0.0-alpha.12
|
||||
CLRVersion
|
||||
CLRVersion
|
||||
WSManStackVersion 3.0
|
||||
PSRemotingProtocolVersion 2.3
|
||||
SerializationVersion 1.1.0.1
|
||||
|
@ -198,56 +214,67 @@ SerializationVersion 1.1.0.1
|
|||
```
|
||||
|
||||
**10. Exit**: To exit the PowerShell session, type "exit".
|
||||
|
||||
```PowerShell
|
||||
PS /home/jen> exit
|
||||
```
|
||||
|
||||
Need Help?
|
||||
----
|
||||
## Need Help?
|
||||
|
||||
The most important command in PowerShell is possibly the Get-Help, which allows you to quickly learn PowerShell without having to search around the internet.
|
||||
The Get-Help cmdlet also shows you how PowerShell commands work with examples.
|
||||
|
||||
It shows the syntax and other technical information of the Get-Process cmdlet.
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Help -Name Get-Process
|
||||
```
|
||||
|
||||
It displays the examples how to use the Get-Process cmdlet.
|
||||
|
||||
```PowerShell
|
||||
PS />Get-Help -Name Get-Process -Examples
|
||||
```
|
||||
|
||||
If you use **-Full** parameter, for example, `Get-Help -Name Get-Process -Full`, it will display more technical information.
|
||||
|
||||
|
||||
Discover Commands Available on Your System
|
||||
----
|
||||
## Discover Commands Available on Your System
|
||||
|
||||
You want to discover what PowerShell cmdlets available on your system? Just run "Get-Command" as below:
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Command
|
||||
```
|
||||
|
||||
If you want to know whether a particular cmdlet exists on your system, you can do something like below:
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Command Get-Process
|
||||
```
|
||||
|
||||
If you want to know the syntax of Get-Process cmdlet, type:
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Command Get-Process -Syntax
|
||||
```
|
||||
|
||||
If you want to know how to use the Get-Process, type:
|
||||
|
||||
```PowerShell
|
||||
PS /> Get-Help Get-Process -Example
|
||||
```
|
||||
|
||||
PowerShell Pipeline '|'
|
||||
----
|
||||
## PowerShell Pipeline '|'
|
||||
|
||||
Sometimes when you run Get-ChildItem or "dir", you want to get a list of files and folders in a descending order.
|
||||
To achieve that, type:
|
||||
|
||||
```PowerShell
|
||||
PS /home/jen> dir | Sort-Object -Descending
|
||||
```
|
||||
|
||||
Say you want to get the largest file in a directory
|
||||
|
||||
```PowerShell
|
||||
PS /home/jen> dir | Sort-Object -Property Length -Descending | Select-Object -First 1
|
||||
|
||||
|
@ -260,14 +287,14 @@ Mode LastWriteTime Length Name
|
|||
-a---- 5/16/2016 1:15 PM 32972 test.log
|
||||
|
||||
```
|
||||
How to Create and Run PowerShell scripts
|
||||
----
|
||||
|
||||
## How to Create and Run PowerShell scripts
|
||||
|
||||
You can use Visual Studio Code or your favorite editor to create a PowerShell script and save it with a `.ps1` file extension.
|
||||
For more details, see [Create and Run PowerShell Script Guide][create-run-script]
|
||||
|
||||
## Recommended Training and Reading
|
||||
|
||||
Recommended Training and Reading
|
||||
----
|
||||
- Video: [Get Started with PowerShell][remoting] from Channel9
|
||||
- [eBooks from PowerShell.org](https://powershell.org/ebooks/)
|
||||
- [eBooks from PowerShell.com][ebooks-powershell.com]
|
||||
|
@ -284,9 +311,8 @@ Recommended Training and Reading
|
|||
- [Writing a PowerShell module in C#][writing-ps-module]
|
||||
- [Examples of Cmdlets Code][sample-code]
|
||||
|
||||
## Commercial Resources
|
||||
|
||||
Commercial Resources
|
||||
----
|
||||
- [Windows PowerShell in Action][in-action] by Bruce Payette
|
||||
- [Windows PowerShell Cookbook][cookbook] by Lee Holmes
|
||||
|
||||
|
|
Loading…
Reference in a new issue