From 77b4105d1f09f992de70091069b89893d7d7b059 Mon Sep 17 00:00:00 2001 From: Aleksandar Nikolic Date: Sat, 16 Jul 2016 23:20:00 +0200 Subject: [PATCH 1/6] Update learning-powershell.md Fixing typos and "More Reading" section. --- .../learning-powershell.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/learning-powerShell/learning-powershell.md b/docs/learning-powerShell/learning-powershell.md index c348295b1..24c3b79c1 100644 --- a/docs/learning-powerShell/learning-powershell.md +++ b/docs/learning-powerShell/learning-powershell.md @@ -2,13 +2,13 @@ Learning PowerShell ==== Whether you're new to programming or an experienced developer, we'll help you get started with PowerShell. -In this document we'll cover the following: installing PowerShell, samples walkthrough, PowerShell editor, debugger, testing tools and a map book for experienced bash users to get started with PowerShell faster. The exercises in this document are intended to give you a solid foundation in how to use PowerShell and get PowerShell to do work for you. You won't be a PowerShell guru at the end of reading this material but you will be well on your way with the right set of knowledge to start using PowerShell. If you have 30 minutes now, let’s try it. +In this document we'll cover the following: installing PowerShell, samples walkthrough, PowerShell editor, debugger, testing tools and a map book for experienced bash users to get started with PowerShell faster. The exercises in this document are intended to give you a solid foundation in how to use PowerShell. You won't be a PowerShell guru at the end of reading this material but you will be well on your way with the right set of knowledge to start using PowerShell. If you have 30 minutes now, let’s try it. Installing PowerShell ---- -First you need to setup your computer working environment if you have not done so. Choose the platform below and follow the instructions. At the end of this exercise, you should be able to launch the PowerShell session. +First you need to set up your computer working environment if you have not done so. Choose the platform below and follow the instructions. At the end of this exercise, you should be able to launch the PowerShell session. - [PowerShell on Linux][powershell-on-linux] @@ -25,14 +25,14 @@ TODO: Raghu for setup-dev-environment.md Getting Started with PowerShell ---- -PowerShell command has a Verb-None structure with a set of parameters. It's easy to learn and use PowerShell. For example, "Get-Process" will display all the running processes on your system. Let's walk through with a few examples by clicking on the [PowerShell Beginner's Guide](powershell-beginners-guide.md). +PowerShell command has a Verb-None structure with a set of parameters. It's easy to learn and use PowerShell. For example, `Get-Process` will display all the running processes on your system. Let's walk through with a few examples by clicking on the [PowerShell Beginner's Guide](powershell-beginners-guide.md). Now you have learned the basics of PowerShell. Please continue reading: Editor, Debugger, and Testing Tool if you want to do some development work in PowerShell. PowerShell Editor ---- -In this section, you will create a PowerShell script using PowerShell editor. You can certainly use your favorite editor to write scripts. As an example, we use Visual Studio Code (VS Code) which works for Windows, Linux, or OS X. Click on the following link to start create your first PowerShell script, let's say helloworld.ps1. +In this section, you will create a PowerShell script using PowerShell editor. You can certainly use your favorite editor to write scripts. As an example, we use Visual Studio Code (VS Code) which works on Windows, Linux, or OS X. Click on the following link to create your first PowerShell script. - [Using Visual Studio Code (VS Code)][use-vscode-editor] @@ -44,7 +44,7 @@ On Windows, you can also use [PowerShell Integrated Scripting Environment (ISE)] PowerShell Debugger ---- -Assuming you have written a PowerShell script which may contains a software bug, you would like to fix the issue via debugging. As an example, we use VS Code. Click on the link below to start debugging: +Assuming you have written a PowerShell script which may contains a software bug, you would like to fix the issue by using debugging. As an example, we use VS Code. Click on the link below to learn more about debugging: - [Using Visual Studio Code (VS Code)][use-vscode-debugger] - [PowerShell Command-line Debugging][cli-debugging] @@ -79,17 +79,17 @@ TODO: Don & JP to fill in More Reading ---- -- Microsoft Virtual Academy: [GetStarted with PowerShell][getstarted-with-powershell] +- Microsoft Virtual Academy: [Getting Started with PowerShell][getstarted-with-powershell] - [Windows PowerShell in Action][in-action] by Bruce Payette -- [Why Learn PowerShell][why-learn-powershell] by Script Guy +- [Why Learn PowerShell][why-learn-powershell] by The Scripting Guys - [Introduction to PowerShell][powershell-intro] from Pluralsight - PowerShell Web Docs: [Basic cookbooks][basic-cookbooks] -- [PowerShell eBooks][ebooks-from-powershell.com] from PowerShell.com +- [PowerShell eBook][ebook-from-powershell.com] from PowerShell.com - [PowerShell Training and Tutorials][lynda-training] from Lynda.com -- [Learn PowerShell][channel9-learn-powershell] from channel9 +- [PowerShell-related Videos][channel9-learn-powershell] on Channel 9 - [Learn PowerShell Video Library][powershell.com-learn-powershell] from PowerShell.com -- [PowerShell Quick Reference][quick-reference] by PowerShellMagazine.com -- [PowerShell 5 How-To Videos][script-guy-how-to] by Script Guy +- [PowerShell Quick Reference Guides][quick-reference] by PowerShellMagazine.com +- [PowerShell 5 How-To Videos][script-guy-how-to] by The Scripting Guys [getstarted-with-powershell]: https://channel9.msdn.com/Series/GetStartedPowerShell3 @@ -97,7 +97,7 @@ More Reading [why-learn-powershell]: https://blogs.technet.microsoft.com/heyscriptingguy/2014/10/18/weekend-scripter-why-learn-powershell/ [powershell-intro]: https://www.pluralsight.com/courses/powershell-intro [basic-cookbooks]: https://msdn.microsoft.com/en-us/powershell/scripting/getting-started/basic-cookbooks -[ebooks-from-powershell.com]: http://powershell.com/cs/blogs/ebookv2/default.aspx +[ebook-from-powershell.com]: http://powershell.com/cs/blogs/ebookv2/default.aspx [lynda-training]: https://www.lynda.com/PowerShell-training-tutorials/5779-0.html [channel9-learn-powershell]: https://channel9.msdn.com/Search?term=powershell#ch9Search [powershell.com-learn-powershell]: http://powershell.com/cs/media/14/default.aspx From e74f294387ae817ed6c478f1074089668a271b64 Mon Sep 17 00:00:00 2001 From: Aleksandar Nikolic Date: Sun, 17 Jul 2016 11:35:04 +0200 Subject: [PATCH 2/6] added newlines Added newlines following one-sentence-per-line principle. --- .../powershell-beginners-guide.md | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/docs/learning-powerShell/powershell-beginners-guide.md b/docs/learning-powerShell/powershell-beginners-guide.md index 7d2dd1013..fb179e663 100644 --- a/docs/learning-powerShell/powershell-beginners-guide.md +++ b/docs/learning-powerShell/powershell-beginners-guide.md @@ -1,7 +1,8 @@ PowerShell Beginners 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. +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 @@ -19,7 +20,8 @@ In this section, you will learn how to - exit a PowerShell session - and more -As mentioned above, PowerShell commands is designed to have Verb-Noun structure, for instance Get-Process, Set-Location, Clear-Host, etc. Let’s exercise some of the basic PowerShell commands, also known as **cmdlets**. +As mentioned above, PowerShell commands is designed to have Verb-Noun structure, for instance Get-Process, Set-Location, Clear-Host, etc. +Let’s exercise some of the basic PowerShell commands, also known as **cmdlets**. Please note that we will use the PowerShell prompt sign **PS />** as it appears on Linux in the following examples. It is shown as **PS C:\\>** on Windows. @@ -39,7 +41,8 @@ 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: +Only interested in the instance of firefox process that are running on your computer? +Try this: ```PowerShell PS /> Get-Process -Name firefox @@ -48,7 +51,9 @@ 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, separating with commas. For example, +Want to get back more than one process? +Then just specify process names, separating with commas. +For example, ```PowerShell PS /> Get-Process -Name firefox, powershell Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName @@ -63,7 +68,8 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName PS /> Get-Process PS /> Clear-Host ``` -Type too much just for clearing the screen? Here is how the alias can help. +Type too much just for clearing the screen? +Here is how the alias can help. **3. Get-Alias**: Improves the user experience by using the Cmdlet aliases @@ -85,7 +91,8 @@ Alias ri -> Remove-Item Alias type -> Get-Content … -As you can see "cls" is an alias of Clear-Host. Now try it: +As you can see "cls" is an alias of Clear-Host. +Now try it: PS /> Get-Process PS /> cls @@ -126,7 +133,9 @@ Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 7/7/2016 7:17 PM 0 test.ps1 ``` -You can use the **-Value** parameter to add some data to your file. For example, the following command adds the phrase "Write-Host 'Hello There'" as a file content to the test.ps1. Because the test.ps1 file exists already, we use **-Force** parameter to replace the existing content. +You can use the **-Value** parameter to add some data to your file. +For example, the following command adds the phrase "Write-Host 'Hello There'" as a file content to the test.ps1. +Because the test.ps1 file exists already, we use **-Force** parameter to replace the existing content. ```PowerShell PS /home/jen> New-Item -Path ./test.ps1 -Value "Write-Host 'hello there'" -Force @@ -139,7 +148,8 @@ Mode LastWriteTime Length Name -a---- 7/7/2016 7:19 PM 24 test.ps1 ``` -There are other ways to add some data to a file. For example, you can use Set-Content to set the file contents: +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.ps1 -Value "Write-Host 'hello there again!'" @@ -172,8 +182,8 @@ PS /home/jen> Remove-Item ./test.ps1 **9. $PSVersionTable**: displays the version of PowerShell you are currently using -Type **$PSVersionTable** in your PowerShell session, you will see something like below. "PSVersion" indicates the -PowerShell version that you are using. +Type **$PSVersionTable** in your PowerShell session, you will see something like below. +"PSVersion" indicates the PowerShell version that you are using. ```PowerShell Name Value @@ -196,7 +206,8 @@ PS /home/jen> exit Need Help? ---- -The most important command in PowerShell is possibly the Get-Help, which allows you to quickly learn PowerShell without having to surf around the Internet. The Get-Help cmdlet also shows you how PowerShell commands work with examples. +The most important command in PowerShell is possibly the Get-Help, which allows you to quickly learn PowerShell without having to surf around the Internet. +The Get-Help cmdlet also shows you how PowerShell commands work with examples. PS />**Get-Help -Name Get-Process** @@ -232,7 +243,8 @@ PS /> **Get-Help Get-Process -Example** PowerShell Pipeline '|' ---- -Sometimes when you run Get-ChildItem or "dir", you want to get a list of files in a descending order. To achieve that, type: +Sometimes when you run Get-ChildItem or "dir", you want to get a list of files in a descending order. +To achieve that, type: ```PowerShell PS /home/jen> dir | sort -Descending ``` @@ -254,7 +266,8 @@ How to Create and Run PowerShell scripts - You can use ISE, VS Code or your favorite editor to create a PowerShell script and save the script with a .ps1 file extension (for example, helloworld.ps1) - To run the script, cd to your current folder and type ./yourscript.ps1 (for example, ./helloworld.ps1). -Note: if you are using Windows, make sure you set the PowerShell's execution policy to "RemoteSigned" in this case. See [Running PowerShell Scripts Is as Easy as 1-2-3] [run-ps] for more details. +Note: if you are using Windows, make sure you set the PowerShell's execution policy to "RemoteSigned" in this case. +See [Running PowerShell Scripts Is as Easy as 1-2-3] [run-ps] for more details. [run-ps]:http://windowsitpro.com/powershell/running-powershell-scripts-easy-1-2-3 From a204e215b766824aa84a697142b89a964db24b4d Mon Sep 17 00:00:00 2001 From: Aleksandar Nikolic Date: Sun, 17 Jul 2016 12:17:17 +0200 Subject: [PATCH 3/6] Fixed typos and code formatting Fixed typos in text and code and properly formatted code. --- .../powershell-beginners-guide.md | 94 +++++++++---------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/docs/learning-powerShell/powershell-beginners-guide.md b/docs/learning-powerShell/powershell-beginners-guide.md index fb179e663..5c4de290d 100644 --- a/docs/learning-powerShell/powershell-beginners-guide.md +++ b/docs/learning-powerShell/powershell-beginners-guide.md @@ -1,4 +1,4 @@ -PowerShell Beginners 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. @@ -20,17 +20,17 @@ In this section, you will learn how to - exit a PowerShell session - and more -As mentioned above, PowerShell commands is designed to have Verb-Noun structure, for instance Get-Process, Set-Location, Clear-Host, etc. +As mentioned above, PowerShell commands are designed to have Verb-Noun structure, for instance Get-Process, Set-Location, Clear-Host, etc. Let’s exercise some of the basic PowerShell commands, also known as **cmdlets**. Please note that we will use the PowerShell prompt sign **PS />** as it appears on Linux in the following examples. -It is shown as **PS C:\\>** on Windows. +It is shown as **PS C:\>** on Windows. **1. Get-Process**: displays the processes running on your system. By default, you will get data back similar to the following: ``` PowerShell -PS />Get-Process +PS /> Get-Process Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName ------- ------ ----- ----- ------ -- ----------- @@ -52,8 +52,7 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName ``` Want to get back more than one process? -Then just specify process names, separating with commas. -For example, +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,7 +62,7 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName ``` -**2. Clear-Host**: Clears the display in the command window +**2. Clear-Host**: Clears the display in the host program. ```PowerShell PS /> Get-Process PS /> Clear-Host @@ -71,9 +70,7 @@ PS /> Clear-Host Type too much just for clearing the screen? Here is how the alias can help. -**3. Get-Alias**: Improves the user experience by using the Cmdlet aliases - -To find the available aliases, you can type below cmdlet: +**3. Get-Alias**: Gets the aliases for the current session. ```PowerShell PS /> Get-Alias @@ -97,12 +94,12 @@ Now try it: PS /> Get-Process PS /> cls ``` -**4. cd - Set-Location**: change your current working directory +**4. cd - Set-Location**: Change your current working directory. ```PowerShell PS /> Set-Location /home PS /home> ``` -**5. dir - Get-ChildItem**: list all items in the specified location +**5. dir - Get-ChildItem**: List all items in the specified location. ```PowerShell Get all files under the current directory: @@ -113,7 +110,7 @@ Get all files under the current directory as well as its subdirectories: PS /> cd $home PS /home/jen> dir -Recurse -List all files with file extension "txt". +List all files with "txt" file extension. PS /> cd $home PS /home/jen> dir –Path *.txt -Recurse @@ -134,11 +131,11 @@ Mode LastWriteTime Length Name -a---- 7/7/2016 7:17 PM 0 test.ps1 ``` You can use the **-Value** parameter to add some data to your file. -For example, the following command adds the phrase "Write-Host 'Hello There'" as a file content to the test.ps1. +For example, the following command adds the phrase "Write-Host 'Hello there!'" as a file content to the test.ps1. Because the test.ps1 file exists already, we use **-Force** parameter to replace the existing content. ```PowerShell -PS /home/jen> New-Item -Path ./test.ps1 -Value "Write-Host 'hello there'" -Force +PS /home/jen> New-Item -Path ./test.ps1 -Value "Write-Host 'Hello there!'" -Force Directory: /home/jen @@ -152,35 +149,35 @@ 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.ps1 -Value "Write-Host 'hello there again!'" +PS /home/jen>Set-Content -Path ./test.ps1 -Value "Write-Host 'Hello there again!'" ``` Or simply use ">" as below: ``` # create an empty file "" > empty.txt -# set "hello world!!!" as content of text.txt file +# set "hello world!!!" as content of empty.txt file "hello world!!!" > empty.txt ``` The pound sign (#) above is used for comments in PowerShell. -**7. type - Get-Content**: get the content of an item +**7. type - Get-Content**: Get the content of an item. ```PowerShell PS /home/jen> Get-Content -Path ./test.ps1 PS /home/jen> type -Path ./test.ps1 -"Write-Host 'hello there again!'" +Write-Host 'Hello there again!' ``` -**8. del - Remove-Item**: delete a file or folder +**8. del - Remove-Item**: Delete a file or folder. This cmdlet will delete the file /home/jen/test.ps1: ```PowerShell PS /home/jen> Remove-Item ./test.ps1 ``` -**9. $PSVersionTable**: displays the version of PowerShell you are currently using +**9. $PSVersionTable**: Displays the version of PowerShell you are currently using. Type **$PSVersionTable** in your PowerShell session, you will see something like below. "PSVersion" indicates the PowerShell version that you are using. @@ -199,51 +196,52 @@ SerializationVersion 1.1.0.1 ``` -**10. Exit**: to exit the PowerShell session, type "exit" +**10. Exit**: To exit the PowerShell session, type "exit". ```PowerShell PS /home/jen> exit ``` Need Help? ---- -The most important command in PowerShell is possibly the Get-Help, which allows you to quickly learn PowerShell without having to surf around the Internet. +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. -PS />**Get-Help -Name Get-Process** - It shows the syntax and other technical information of the Get-Process cmdlet. - - -PS />**Get-Help -Name Get-Process -Examples** +```PowerShell +PS /> Get-Help -Name Get-Process +``` It displays the examples how to use the Get-Process cmdlet. -If you use **-Full** parameter, i.e., "Get-Help -Name Get-Process -Full", it will display more technical information. +```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 All Commands Available on Your System +Discover Commands Available on Your System ---- -You want to discover what PowerShell cmdlets available on your system? Simple, just run "Get-Command" as below. - -PS /> **Get-Command** - +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: - -PS /> **Get-Command Get-Process** - -If you want to know the syntax of Get-Process cmdlet, type - -PS /> **Get-Command Get-Process -Syntax** - -If you want to know how to use the Get-Process, type - -PS /> **Get-Help Get-Process -Example** - +```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 '|' ---- -Sometimes when you run Get-ChildItem or "dir", you want to get a list of files in a descending order. +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 -Descending @@ -266,7 +264,7 @@ How to Create and Run PowerShell scripts - You can use ISE, VS Code or your favorite editor to create a PowerShell script and save the script with a .ps1 file extension (for example, helloworld.ps1) - To run the script, cd to your current folder and type ./yourscript.ps1 (for example, ./helloworld.ps1). -Note: if you are using Windows, make sure you set the PowerShell's execution policy to "RemoteSigned" in this case. +Note: If you are using Windows, make sure you set the PowerShell's execution policy to "RemoteSigned" in this case. See [Running PowerShell Scripts Is as Easy as 1-2-3] [run-ps] for more details. [run-ps]:http://windowsitpro.com/powershell/running-powershell-scripts-easy-1-2-3 From 03c7ab128683ba293f0a17da7c23cc8d20ac578f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Nikoli=C4=87?= Date: Tue, 19 Jul 2016 04:33:33 +0200 Subject: [PATCH 4/6] Update powershell-beginners-guide.md Fixed "Hello world!" example and changed test.ps1 to test.txt. --- .../powershell-beginners-guide.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/learning-powerShell/powershell-beginners-guide.md b/docs/learning-powerShell/powershell-beginners-guide.md index 5c4de290d..cb09f2255 100644 --- a/docs/learning-powerShell/powershell-beginners-guide.md +++ b/docs/learning-powerShell/powershell-beginners-guide.md @@ -120,7 +120,7 @@ PS /home/jen> dir –Path *.txt -Recurse ```PowerShell An empty file is created if you type the following: -PS /home/jen> New-Item -Path ./test.ps1 +PS /home/jen> New-Item -Path ./test.txt Directory: /home/jen @@ -128,36 +128,36 @@ PS /home/jen> New-Item -Path ./test.ps1 Mode LastWriteTime Length Name ---- ------------- ------ ---- --a---- 7/7/2016 7:17 PM 0 test.ps1 +-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 "Write-Host 'Hello there!'" as a file content to the test.ps1. -Because the test.ps1 file exists already, we use **-Force** parameter to replace the existing content. +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. ```PowerShell -PS /home/jen> New-Item -Path ./test.ps1 -Value "Write-Host 'Hello there!'" -Force +PS /home/jen> New-Item -Path ./test.txt -Value "Hello world!" -Force Directory: /home/jen Mode LastWriteTime Length Name ---- ------------- ------ ---- --a---- 7/7/2016 7:19 PM 24 test.ps1 +-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.ps1 -Value "Write-Host 'Hello there again!'" +PS /home/jen>Set-Content -Path ./test.txt -Value "Hello world again!" ``` Or simply use ">" as below: ``` # create an empty file -"" > empty.txt +"" > test.txt -# set "hello world!!!" as content of empty.txt file -"hello world!!!" > empty.txt +# set "Hello world!" as content of test.txt file +"Hello world!!!" > test.txt ``` The pound sign (#) above is used for comments in PowerShell. @@ -165,16 +165,16 @@ The pound sign (#) above is used for comments in PowerShell. **7. type - Get-Content**: Get the content of an item. ```PowerShell -PS /home/jen> Get-Content -Path ./test.ps1 -PS /home/jen> type -Path ./test.ps1 +PS /home/jen> Get-Content -Path ./test.txt +PS /home/jen> type -Path ./test.txt -Write-Host 'Hello there again!' +Hello world again! ``` **8. del - Remove-Item**: Delete a file or folder. -This cmdlet will delete the file /home/jen/test.ps1: +This cmdlet will delete the file /home/jen/test.txt: ```PowerShell -PS /home/jen> Remove-Item ./test.ps1 +PS /home/jen> Remove-Item ./test.txt ``` **9. $PSVersionTable**: Displays the version of PowerShell you are currently using. From 77e5f460be9e996aa8b07e87c045517210a87ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Nikoli=C4=87?= Date: Tue, 19 Jul 2016 04:42:36 +0200 Subject: [PATCH 5/6] Update powershell-beginners-guide.md Changing descriptions for cmdlets with a synopsis from the help files. --- .../powershell-beginners-guide.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/learning-powerShell/powershell-beginners-guide.md b/docs/learning-powerShell/powershell-beginners-guide.md index cb09f2255..41bf01d13 100644 --- a/docs/learning-powerShell/powershell-beginners-guide.md +++ b/docs/learning-powerShell/powershell-beginners-guide.md @@ -26,7 +26,7 @@ Let’s exercise some of the basic PowerShell commands, also known as **cmdlets* Please note that we will use the PowerShell prompt sign **PS />** as it appears on Linux in the following examples. It is shown as **PS C:\>** on Windows. -**1. Get-Process**: displays the processes running on your system. +**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 @@ -94,12 +94,12 @@ Now try it: PS /> Get-Process PS /> cls ``` -**4. cd - Set-Location**: Change your current working directory. +**4. cd - Set-Location**: Sets the current working location to a specified location. ```PowerShell PS /> Set-Location /home PS /home> ``` -**5. dir - Get-ChildItem**: List all items in the specified location. +**5. dir - Get-ChildItem**: Gets the items and child items in one or more specified locations. ```PowerShell Get all files under the current directory: @@ -116,7 +116,7 @@ PS /> cd $home PS /home/jen> dir –Path *.txt -Recurse ``` -**6. New-Item**: Create a file +**6. New-Item**: Creates a new item. ```PowerShell An empty file is created if you type the following: @@ -162,7 +162,7 @@ Or simply use ">" as below: ``` The pound sign (#) above is used for comments in PowerShell. -**7. type - Get-Content**: Get the content of an item. +**7. type - Get-Content**: Gets the content of the item at the specified location. ```PowerShell PS /home/jen> Get-Content -Path ./test.txt @@ -170,7 +170,7 @@ PS /home/jen> type -Path ./test.txt Hello world again! ``` -**8. del - Remove-Item**: Delete a file or folder. +**8. del - Remove-Item**: Deletes the specified items. This cmdlet will delete the file /home/jen/test.txt: ```PowerShell From 4280bf623c3a17150d20c77c28b54532babf23f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Nikoli=C4=87?= Date: Tue, 19 Jul 2016 19:16:20 +0200 Subject: [PATCH 6/6] Update learning-powershell.md Fixed Verb-Noun typo. --- docs/learning-powerShell/learning-powershell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learning-powerShell/learning-powershell.md b/docs/learning-powerShell/learning-powershell.md index 24c3b79c1..d3f75bd3b 100644 --- a/docs/learning-powerShell/learning-powershell.md +++ b/docs/learning-powerShell/learning-powershell.md @@ -25,7 +25,7 @@ TODO: Raghu for setup-dev-environment.md Getting Started with PowerShell ---- -PowerShell command has a Verb-None structure with a set of parameters. It's easy to learn and use PowerShell. For example, `Get-Process` will display all the running processes on your system. Let's walk through with a few examples by clicking on the [PowerShell Beginner's Guide](powershell-beginners-guide.md). +PowerShell command has a Verb-Noun structure with a set of parameters. It's easy to learn and use PowerShell. For example, `Get-Process` will display all the running processes on your system. Let's walk through with a few examples by clicking on the [PowerShell Beginner's Guide](powershell-beginners-guide.md). Now you have learned the basics of PowerShell. Please continue reading: Editor, Debugger, and Testing Tool if you want to do some development work in PowerShell.