Book Image

PowerShell Core for Linux Administrators Cookbook

By : Prashanth Jayaram, Ram Iyer
Book Image

PowerShell Core for Linux Administrators Cookbook

By: Prashanth Jayaram, Ram Iyer

Overview of this book

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.
Table of Contents (19 chapters)

Who this book is for

This book is for you if you are a Linux administrator who's open to other scripting frameworks, a system administrator who manages Linux as well as Windows workloads, and is looking to unify management, a Linux administrator who wants a framework that easily handles structured data, a Windows administrator who is new to PowerShell and wants to learn PowerShell scripting, or if you are a system administrator who is just generally curious.

Bash is, without a doubt, a great shell. While Windows PowerShell uses many Linux commands as convenience aliases, PowerShell Core on Linux is unobtrusive. PowerShell Core on Linux treats Linux commands as Linux commands (and not as convenience aliases) and calls the respective application, such as ls or grep. This way, PowerShell Core sits well in the Linux framework, and provides system administrators with a flexible, quickly-evolving toolset that enables them to write a script once and run the script everywhere—on Linux or Windows.

PowerShell is perhaps the only framework in Linux that works well with structured data. Structured data and the object model simplify automation, by packaging related data and functions within the object. Access to these members of the objects improve efficiency, thereby making automation smoother.

This book understands that an object-oriented shell has mostly been unheard of (OS/2 Workspace Shell, anybody?), and takes the reader through the concept of an object-oriented shell. Therefore, this book assumes some very basic knowledge on the reader's part, with respect to how an operating system is structured and how to use the command-line interface to work with the operating system. No experience in PowerShell is assumed.

In this book, you will learn the following topics:

  • The fundamentals of .NET Core and PowerShell Core
  • How to work with .NET (and, by extension, PowerShell) objects, understanding how they are structured and how they work
  • The different constructs, and how to create scripts, functions, and simple script modules, all with best practices in mind
  • The administration of computers locally as well as remotely, including scheduling remote jobs and retrieving their output
  • How to work with the cloud (Amazon Web Services has been touched upon, while Azure has been covered in more detail)