Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Powershell Core 6.2 Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Powershell Core 6.2 Cookbook

Powershell Core 6.2 Cookbook

By : Jan-Hendrik Peters
close
close
Powershell Core 6.2 Cookbook

Powershell Core 6.2 Cookbook

By: Jan-Hendrik Peters

Overview of this book

This book will follow a recipe-based approach and start off with an introduction to the fundamentals of PowerShell, and explaining how to install and run it through simple examples. Next, you will learn how to use PowerShell to access and manipulate data and how to work with different streams as well. You will also explore the object model which will help with regard to PowerShell function deployment. Going forward, you will get familiar with the pipeline in its different use cases. The next set of chapters will deal with the different ways of accessing data in PowerShell. You will also learn to automate various tasks in Windows and Linux using PowerShell Core, as well as explore Windows Server. Later, you will be introduced to Remoting in PowerShell Core and Just Enough Administration concept. The last set of chapters will help you understand the management of a private and public cloud with PowerShell Core. You will also learn how to access web services and explore the high-performance scripting methods. By the end of this book, you will gain the skills to manage complex tasks effectively along with increasing the performance of your environment.
Table of Contents (14 chapters)
close
close

To get the most out of this book

To get the most out of this book, I recommend deploying this book's lab environment, which consists of the following:

  • A Domain Controller/Router/Certificate Authority (recipes requiring Active Directory)
  • Three file servers (SOFS and S2D recipes)
  • Two Hyper-V hosts (Hyper-V and clustering recipes)
  • A web server (IIS recipes) with SQL
  • A CentOS 7.4 node (Linux recipes)

Should you decide to use your own infrastructure, please adapt the server names used in the recipes!

Lab requirements

To deploy the lab for the entire book, you need a Hyper-V host (recommended) or an Azure subscription (caution: deploying the lab will incur substantial costs if you do not deallocate the machines!). The requirements for your Hyper-V host are as follows:

  • Windows 10/Server 2016
  • A virtualization-enabled, modern processor (i5 or similar)
  • At least 20 GiB RAM if all machines are up and running
  • At least 50 GiB of free space on an SSD (no spinning disks)
  • Deploy the lab using Windows PowerShell
  • The Hyper-V feature needs to be enabled (requires a restart)
  • One ISO file Windows Server 2016 Datacenter
  • One ISO file SQL Server 2017 (Standard or Datacenter)
  • One ISO file CentOS 7.4; a DVD image is recommended, since a network image requires an internet-connected host!

Deploying the lab will download the PowerShell module, AutomatedLab, which is used to aid rapid lab deployments. The entire lab will be built on the fly. If you are done with the lab and want to remove it, open an administrative PowerShell session and execute Remove-Lab -Name PSCookBook.

The lab deployment script can be found in the book's repository at https://github.com/PacktPublishing/Powershell-Core-6.2-Cookbook/tree/master/Chapter00.

Recipe recommendations

To follow all the recipes in this book, I recommend the following:

Any code can be found at https://github.com/PacktPublishing/Powershell-Core-6.2-Cookbook.

Take care not to execute the scripts as a whole. I have added a throw statement to each recipe script so that you do not accidentally execute it entirely.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Powershell-Core-6.2-Cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

public Car(string make, string model, ConsoleColor color)
{
Color = color;
Make = make;
Model = model;
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

From https://docs.microsoft.com/en-us/dotnet/api/system.boolean.tryparse?view=netcore-2.2:
public static bool TryParse (string value, out bool result);

Any command-line input or output is written as follows:

$car = New-Object -TypeName Vehicle.Car

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY