Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

PowerShell: A Comprehensive Guide to Windows PowerShell
PowerShell: A Comprehensive Guide to Windows PowerShell
PowerShell: A Comprehensive Guide to Windows PowerShell
Ebook93 pages1 hour

PowerShell: A Comprehensive Guide to Windows PowerShell

Rating: 3.5 out of 5 stars

3.5/5

()

Read preview

About this ebook

POWERSHELL


Are you looking for an easy way to simplify and automate administration of all your Microsoft products? You can't go wrong with Windows PowerShell, one of the most powerful scripting languages ever devised!


PowerShell makes it easy to retrieve data about your system se

LanguageEnglish
Release dateNov 11, 2020
ISBN9781761036828
PowerShell: A Comprehensive Guide to Windows PowerShell

Read more from Sam Griffin

Related to PowerShell

Related ebooks

Operating Systems For You

View More

Related articles

Reviews for PowerShell

Rating: 3.5 out of 5 stars
3.5/5

2 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    PowerShell - Sam Griffin

    Introduction

    Are you looking for an easy way to simplify and automate administration of all your Microsoft products? You can’t go wrong with Microsoft PowerShell, one of the most powerful scripting languages ever devised. And don’t let the term, scripting language scare you off either; PowerShell is remarkably easy to learn and has one of the most comprehensive support systems of any programming or scripting language.

    PowerShell makes it easy to retrieve data about your system settings, manage your services, change objects and much more; learning it now will help you to reduce how much time you have to spend, or waste as the case may be, on admin functions and all without the need to purchase expensive tools or services from elsewhere. It comes built into Windows 10, so you don’t even have to go through the hassle of downloading and setting it up – it’s all there, just waiting for you to use.

    In this guide, we will cover:

    What PowerShell is and what its uses are

    PowerShell cmdlets (commands)

    PowerShell scripts

    PowerShell strings and quotes

    PowerShell Automation and PowerShell Remoting

    Rather than having one underlying theme running through the book, I have set it out so that you can pick and choose the chapter you want to read, depending on your needs at the time.

    Welcome to the wonders of Windows PowerShell.

    Chapter 1: Introduction to PowerShell

    Let’s start with the basics – what is PowerShell and what can it do for you?

    These days, there are multiple ways for you to interact with a computer system and manage it from the GUI (graphical user interface) to the CLI (command-line interface). Some people consider the latter as a huge backward step, back to the time of those old-fashioned green-screened terminals. However, today we still use it, together with web-based interfaces and API (application programming interface) calls.

    But why have we gone back to the command line? To understand that, you need to understand what goes into large-scale computer system administration. Repetitive tasks take up a lot of admin time, and it is necessary to do these as quickly and efficiently as possible, especially with multiple systems requiring management. Add to that the need to make sure those tasks are done the same way every time to ensure the right results and you start to understand why the command-line interface method is so important. One of the most common command-line interfaces is Microsoft PowerShell.

    What is it?

    PowerShell is an automation and scripting platform developed by Microsoft. Built on the .NET framework, it combines an interactive command environment with a scripting language, and has been described by Ed Wilson, a leading resource on PowerShell, as follows:

    Windows PowerShell is an interactive object-oriented command environment with scripting language features that utilizes small programs called cmdlets to simplify configuration, administration, and management of heterogeneous environments in both standalone and networked typologies by utilizing standards-based remoting protocols.

    That’s quite the definition! Let’s delve into it a bit deeper.

    Explain Object-Oriented

    In essence, an object-oriented programming language is a kind of logic, a way of understanding how a language or platform behaves. Everything in the language is an object. Python is perhaps the most famous of all object-oriented programming languages.

    An object has at least one attribute and at least one method or function – have a look at some real-world examples:

    A TV remote control – attributes include color, shape, size, how many buttons it has, etc. Functions or methods include volume adjustment, changing channels and turning the TV on and off.

    A vehicle – attributes include current speed, location, license plate, etc., while methods include moving, acceleration, slowing and parking.

    A dog – attributes include breed, color, energy levels and mood, while methods include barking, sleeping, running, playing, etc.

    Explain Cmdlets

    Short for command-lets, a cmdlet is a PowerShell command and there are lots of them. Each cmdlet is responsible for a specific task or function, and we’ll be covering them in detail in the next chapter. Behind a cmdlet, a lot is going on. When it is executed, the command works with multiple objects, methods, classes, API calls, and lots of other things, all to get its job done. The primary advantage of using PowerShell is that there is no need to understand all of this; the cmdlet takes care of everything.

    To help you in using these cmdlets, PowerShell uses a naming pattern, verb-noun, to help you understand what each one is for. Some of the verbs you will encounter include Set, New, Get, Copy, and Add. Putting the verbs and nouns together gives

    Enjoying the preview?
    Page 1 of 1