▶Book Description
PowerShell Core, the open source, cross-platform that is based on the open source, cross-platform .NET Core, is not a shell that came out by accident; it was intentionally created to be versatile and easy to learn at the same time. PowerShell Core enables automation on systems ranging from the Raspberry Pi to the cloud.
PowerShell Core for Linux Administrators Cookbook uses simple, real-world examples that teach you how to use PowerShell to effectively administer your environment. As you make your way through the book, you will cover interesting recipes on how PowerShell Core can be used to quickly automate complex, repetitive, and time-consuming tasks. In the concluding chapters, you will learn how to develop scripts to automate tasks that involve systems and enterprise management.
By the end of this book, you will have learned about the automation capabilities of PowerShell Core, including remote management using OpenSSH, cross-platform enterprise management, working with Docker containers, and managing SQL databases.
▶What You Will Learn
⦁ Leverage the object model of the shell, which is based on .NET Core
⦁ Administer computers locally as well as remotely using PowerShell over OpenSSH
⦁ Get to grips with advanced concepts of PowerShell functions
⦁ Use PowerShell for administration on the cloud
⦁ Know the best practices pertaining to PowerShell scripts and functions
⦁ Exploit the cross-platform capabilities of PowerShell to manage scheduled jobs, Docker containers and SQL Databases
▶Key Features
⦁ Work effectively on Windows, Linux, and macOS with PowerShell's object-oriented approach and capabilities
⦁ Handle structured data seamlessly without the need for manual parsing
⦁ Enhance your native Linux capabilities with PowerShell Core 6.1
▶Who This Book Is For
PowerShell Core for Linux Administrators Cookbook is for you if you are a system administrator who wants to learn to control and automate a Linux environment with PowerShell Core 6.1. Basic knowledge of PowerShell scripting is necessary. It is assumed that you already understand how an operating system is structured and how to use the command-line interface to work with the operating system.
▶What this book covers
⦁ Chapter 1, Introducing PowerShell Core, introduces PowerShell Core. The chapter covers the installation of PowerShell and the basic setup, along with an introduction to objects.
⦁ Chapter 2, Preparing for Administration Using PowerShell, helps to understand how PowerShell behaves, how to efficiently write commands by reducing keystrokes, and how redirection works.
⦁ Chapter 3, First Steps in Administration Using PowerShell, introduces the basic utilities, such as finding and working with processes running in the system.
⦁ Chapter 4, Passing Data through the Pipelines, demonstrates how the pipeline works, and how to leverage it to work with the returned objects.
⦁ Chapter 5, Using Variables and Objects, focuses on the built-in variables, the environment, and working with objects, including extending existing objects and creating custom ones.
⦁ Chapter 6, Working with Strings, introduces the string as an object, and walks through string manipulation using operators as well as the methods built into the string objects.
⦁ Chapter 7, Flow Control Using Branches and Loops, walks through using branching and looping constructs to control the flow of scripts and functions.
⦁ Chapter 8, Performing Calculations, briefly demonstrates how to work with numbers by performing arithmetic operations, calculations, and conversions, along with introducing the administrative constants.
⦁ Chapter 9, Using Arrays and Hashtables, explains how arrays and hash tables are created, used, and manipulated in PowerShell.
⦁ Chapter 10, Handling Files and Directories, focuses on file and directory operations, such as sending and retrieving content to and from a file, searching for content, and working with structured as well as unstructured files.
⦁ Chapter 11, Building Scripts and Functions, begins with creating a simple script and then proceeds to writing functions that accept arguments.
⦁ Chapter 12, Advanced Concepts of Functions, extends the knowledge gained in the previous chapters and introduces the concepts of parameters, parameter aliases and sets, working with dependencies, adding help, and so on, in order to create functions that behave like cmdlets.
⦁ Chapter 13, Debugging and Error Handling, shows how to work with, and handle, errors and warnings, and walks through how to use the debug tab of Visual Studio Code.
⦁ Chapter 14, Enterprise Administration Using PowerShell, covers how to set up PowerShell for remote access and enterprise administration. It explains the use of PowerShell across Windows and Linux environments.
⦁ Chapter 15, PowerShell and Cloud Operations, aims at getting started with cloud administration using PowerShell. This chapter introduces the use of PowerShell on Azure and AWS cloud services.
⦁ Chapter 16, Using PowerShell for SQL Database Management, introduces PowerShell for SQL database management, starting from the installation of the SQL Server module through to integrating Python with PowerShell for database management.
⦁ Chapter 17, Using PowerShell with Docker, explains the implementation of Docker management using PowerShell. Coupled with the understanding gained in Chapter 1, Introducing PowerShell Core, this chapter explains how to use the Docker module, as well as using the Docker API with .NET Core.