官术网_书友最值得收藏!

Running PowerShell

Different versions of Windows come with different version of PowerShell. For example, Windows 8 and Windows Server 2013 have PowerShell 3.0, whereas Windows 8.1 comes with PowerShell 4.0 by default. On Windows 10 and later, you see PowerShell 5 installed by default. For now, we will just focus on running PowerShell on your Windows desktop. I am running Windows 10 at the time of writing this book; thus I will use Windows 10 to demonstrate the concept to know more about PowerShell. At the same time, this chapter is not intended to make you an expert in PowerShell scripting; it is rather to help you know the very basics of the PowerShell environment so that you are all set for the journey that you are planning in this book to learn AWS Tools for PowerShell Core. This would help if you are new to PowerShell. You do not need to be an expert, but understanding the basic commands in PowerShell will help you. If you are keen to learn more about PowerShell, my suggestion is to consider buying other PowerShell-related books or take some online training to gain more insight into this beautiful scripting language.

You only need to type the first few letters of the word PowerShell on the start screen. As we discussed earlier, Microsoft announced PowerShell Core 6, which is still in beta at the time of writing this book. So, I have downloaded the PowerShell Core 6 beta version from the GitHub repository. I will be using PowerShell Core 6 on Windows 10 as we move forward. You may want to pin PowerShell into your taskbar rather than starting this way, by typing in the start screen window every time you run PowerShell:

There are four options that you will see in most of the Windows PowerShell environment. If you see (x86) in the options, such as Windows PowerShell (x86) or Windows PowerShell ISE (x86), it means that it is 32-bit binaries for PowerShell, and without (x86) they are 64-bit binaries available for PowerShell. Windows PowerShell ISE is a nice GUI and an Integrated Scripting Environment (ISE). You can start an ISE environment by clicking on Windows PowerShell ISE ;or by just running the ise command inside PowerShell. The best thing about ISE is that it has a lot of advantages to it. Not only can you see the scripting pane at the top, which allows you to write rich and robust scripts, but you can also have error checks and debugging built into it, so you can step through the script one at a time if you want to do so.

Once you start PowerShell, you can mostly use get-host or $PSVersionTable to check the version of PowerShell. get-host works in all versions of PowerShell, whereas $PSVersionTable works in PowerShell version 2 and later.

主站蜘蛛池模板: 徐闻县| 卢湾区| 连平县| 榆社县| 贡觉县| 密山市| 厦门市| 桂阳县| 大城县| 和田县| 黑龙江省| 乐陵市| 汉源县| 普定县| 定边县| 舟曲县| 绥德县| 梁平县| 红原县| 兴山县| 宜丰县| 太仆寺旗| 石泉县| 南木林县| 孝昌县| 厦门市| 明水县| 敦煌市| 乐陵市| 商都县| 和政县| 铅山县| 安平县| 信宜市| 花莲市| 卫辉市| 且末县| 泉州市| 萨嘎县| 灵宝市| 巴中市|