ebook img

Windows Server Automation with PowerShell Cookbook: Powerful ways to automate, manage and administrate Windows Server 2022 using PowerShell 7.2, 5th Edition PDF

715 Pages·2023·65.101 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Windows Server Automation with PowerShell Cookbook: Powerful ways to automate, manage and administrate Windows Server 2022 using PowerShell 7.2, 5th Edition

Windows Server Automation with PowerShell Cookbook Fifth Edition Powerful ways to automate, manage, and administrate Windows Server 2022 using PowerShell 7.2 Thomas Lee BIRMINGHAM—MUMBAI Windows Server Automation with PowerShell Cookbook Fifth Edition Copyright © 2023 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Senior Publishing Product Manager: Aaron Tanna Acquisition Editor – Peer Reviews: Gaurav Gavas Project Editor: Meenakshi Vijay Content Development Editor: Liam Draper Copy Editor: Safis Editing Technical Editor: Karan Sonawane Proofreader: Safis Editing Indexer: Subalakshmi Govindhan Presentation Designer: Rajesh Shirsath Developer Relations Marketing Executive: Meghal Patel First published: March 2013 Second edition: September 2017 Third edition: February 2019 Fourth edition: July 2021 Fifth edition: January 2023 Production reference: 1270123 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-80461-423-5 www.packt.com Contributors About the author Thomas Lee is a consultant, trainer, and writer from England and has been in the IT business since the late 1960s. After graduating from Carnegie Mellon University, Thomas joined ComS- hare, where he was a systems programmer building the Commander II time-sharing operating system, a forerunner of today’s cloud computing paradigm. In the mid 1970s, he moved to ICL to work on the VME/K operating system. After a sabbatical in 1980 and 1981, he joined what is today known as Accenture, leaving in 1988 to run his own consulting and training business, which is still active today. Thomas worked for Microsoft in Redmond to develop both multiple Microsoft official training courses and several chapters on DNS for the Windows Server 2003 Resource kit. Later, Thomas also worked for both QA (as Chief Technologist), and for Global Knowledge as Chief Architect. In both roles, he developed and delivered training for a variety of customers, including Microsoft. Today, Thomas writes, trains, and consults. He is a site moderator and PowerShell group ad- ministrator at the popular SpiceWorks.com site. He is responsible for and a major contributor to the Microsoft PowerShell Community blog (https://devblogs.microsoft.com/powershell- community/). Thomas holds numerous Microsoft certifications, including MCSE (one of the first in the world) and later versions, MCT (25 years), and has been awarded Microsoft’s MVP award 17 times. Over the years, he has written and contributed to a variety of books on Windows and TCP/IP. He lives today in a cottage in the English countryside with his family, a nice wine cellar, and a huge collection of live recordings by The Grateful Dead and The Jerry Garcia Band. About the reviewer Mike Roberts is a PowerShell ninja not only in his profession, but also teaches it on his blog: https://gngr.ninja. Through his blog, he hopes to inspire others by showing them what dif- ferent technologies are capable of. I am eternally grateful for the support of my family, and Destiny. Thank you! Join our community on Discord Join our community’s Discord space for discussions with the author and other readers: https://packt.link/SecNet Table of Contents Preface xxvii Chapter 1: Installing and Configuring PowerShell 7 1 Introduction ����������������������������������������������������������������������������������������������������������������������� 1 Systems used in the chapter • 3 Installing PowerShell 7 ������������������������������������������������������������������������������������������������������� 3 Getting ready • 4 How to do it... • 4 How it works... • 5 There’s more... • 8 Installing PowerShell 7 Using Chocolatey ��������������������������������������������������������������������������� 9 Getting ready • 10 How to do it... • 10 How it works... • 11 There’s more... • 14 Using the PowerShell 7 Console ���������������������������������������������������������������������������������������� 14 Getting ready • 14 How to do it... • 14 How it works... • 15 There’s more... • 18 Building PowerShell 7 Profile Files ������������������������������������������������������������������������������������ 18 Getting ready • 19 viii Table of Contents How to do it... • 19 How it works... • 20 There’s more... • 21 Exploring Installation Artifacts ����������������������������������������������������������������������������������������� 21 Getting ready • 22 How to do it... • 22 How it works... • 23 There’s more... • 25 Installing VS Code ������������������������������������������������������������������������������������������������������������� 26 Getting ready • 27 How to do it... • 27 How it works... • 31 There’s more... • 35 Installing the Cascadia Code Font ������������������������������������������������������������������������������������� 35 How to do it... • 36 How it works... • 36 There’s more... • 37 Exploring PSReadLine ������������������������������������������������������������������������������������������������������� 37 How to do it... • 38 How it works... • 39 There’s more... • 41 Chapter 2: Managing PowerShell 7 in the Enterprise 43 Introduction ��������������������������������������������������������������������������������������������������������������������� 43 The system used in the chapter • 45 Utilizing Windows PowerShell Compatibility ������������������������������������������������������������������� 46 Getting ready • 47 How to do it... • 47 How it works... • 48 There’s more... • 50 Table of Contents ix Installing RSAT ������������������������������������������������������������������������������������������������������������������ 51 Getting ready • 51 How to do it... • 52 How it works... • 54 There’s more... • 58 Exploring Package Management ��������������������������������������������������������������������������������������� 58 Getting ready • 59 How to do it... • 59 How it works... • 60 There’s more... • 63 Exploring PowerShellGet and the PS Gallery �������������������������������������������������������������������� 63 Getting ready • 64 How to do it... • 64 How it works... • 65 There’s more... • 70 Creating and Using a Local Package Repository ����������������������������������������������������������������� 71 Getting ready • 71 How to do it... • 72 How it works... • 74 There’s more... • 75 Establishing a Script Signing Environment ����������������������������������������������������������������������� 75 Getting ready • 77 How to do it... • 77 How it works... • 79 There’s more... • 84 Working With Shortcuts and the PSShortCut Module ������������������������������������������������������ 85 Getting ready • 86 How to do it... • 86 How it works... • 87 There’s more... • 91

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.