Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Powershell Core 6.2 Cookbook

You're reading from  Powershell Core 6.2 Cookbook

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789803303
Pages 372 pages
Edition 1st Edition
Languages
Author (1):
Jan-Hendrik Peters Jan-Hendrik Peters
Profile icon Jan-Hendrik Peters
Toc

Table of Contents (14) Chapters close

Preface 1. Introduction to PowerShell Core 2. Reading and Writing Output 3. Working with Objects 4. Mastering the Pipeline 5. Importing, Using, and Exporting Data 6. Windows and Linux Administration 7. Windows Server Administration 8. Remoting and Just Enough Administration 9. Using PowerShell for Hyper-V and Azure Stack Management 10. Using PowerShell with Azure and Google Cloud 11. Accessing Web Services 12. High-Performance Scripting 13. Other Books You May Enjoy

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:

  • Register for a free Azure DevOps account at https://dev.azure.com to follow the Azure DevOps recipes.
  • Register for a free Microsoft Azure account at https://azure.microsoft.com/en-us/free to follow all Azure recipes.
  • Register for a free Google Cloud account at https://cloud.google.com to follow all Google Cloud recipes.

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

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/9781789803303_ColorImages.pdf.

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.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}