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 Windows Server Automation with PowerShell Cookbook, Fifth Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Windows Server Automation with PowerShell Cookbook, Fifth Edition

Windows Server Automation with PowerShell Cookbook, Fifth Edition

By : Thomas Lee
4.7 (21)
close
close
Windows Server Automation with PowerShell Cookbook, Fifth Edition

Windows Server Automation with PowerShell Cookbook, Fifth Edition

4.7 (21)
By: Thomas Lee

Overview of this book

The Windows Server Automation with PowerShell Cookbook is back with a new edition, featuring over 100 PowerShell recipes that will make your day-to-day work easier. This book is designed to help you learn how to install, configure and use PowerShell 7.2 effectively. To start with, we’ll look at how to install and configure PowerShell 7.2, along with useful new features and optimizations, and show you how the PowerShell compatibility solution bridges the gap to older versions of PowerShell. We’ll also be covering a wide range of fundamental and more advanced use cases, including how to create a VM and set up an Azure VPN, as well as looking at how to back up to Azure. As you progress, you’ll explore topics such as using PowerShell to manage networking and DHCP in Windows Server, objects in Active Directory, Hyper-V, and Azure. We’ll also take a closer look at WSUS, containers and see how to handle modules that are not directly compatible with PowerShell 7. Finally, you’ll also learn how to use some powerful tools to diagnose and resolve issues with Windows Server. By the end of this PowerShell book, you’ll know how to use PowerShell 7.2 to automate tasks on Windows Server 2022 with ease, helping your Windows environment to run faster and smoother.
Table of Contents (17 chapters)
close
close
15
Other Books You May Enjoy
16
Index

Installing the Cascadia Code Font

Fonts, like color schemes in general, are a very personal thing. Some people love the comic sans font, for example, while others loathe it. Some love dark themes, and others don’t. For programming, including PowerShell (with the console, VS Code, and possibly even Notepad), fixed-width fonts are easier to use. But the choice of which font is always a personal preference.

As part of the Visual Studio Code launch, Microsoft also created a new and free font that you can download and use at the PowerShell 7 console and inside VS Code. This recipe shows how you can download the font, install it, and set this font to be the default in VS Code.

This recipe shows how to install the Cascadia Code font, but you can choose many great fonts. See this article on (arguably!) the ten best fonts for use with VS Code: https://toastofcode.com/best-fonts-for-programming-with-vscode/.

And should you want to use a different font for VS Code, you can adapt this recipe to make use of whatever font you wish. Or use the VS Code settings menus to change the font as you may want.

How to do it...

  1. Getting download locations
    $CascadiaRelURL  = 
            'https://github.com/microsoft/cascadia-code/releases'
    $CascadiaRelease = Invoke-WebRequest -Uri $CascadiaRelURL
    $Fileleaf        = ($CascadiaRelease.Links.href |
                         Where-Object { $_ -match $CascadiaFont } |
                           Select-Object -First 1)
    $CascadiaPath   = 'https://github.com' + $FileLeaf
    $CascadiaFile   = 'C:\Foo\CascadiaFontDL.zip'
    
  2. Downloading the Cascadia Code font file archive
    Invoke-WebRequest -Uri $CascadiaPath -OutFile $CascadiaFile
    
  3. Expanding the font archive file
    $FontFolder = 'C:\Foo\CascadiaCode'
    Expand-Archive -Path $CascadiaFile -DestinationPath $FontFolder
    
  4. Installing the Cascadia Code font
    $FontFile = 'c:\Foo\CascadiaCode\ttf\CascadiaCode.ttf'
    $FontShellApp = New-Object -Com Shell.Application
    $FontShellNamespace = $FontShellApp.Namespace(0x14)
    $FontShellNamespace.CopyHere($FontFile, 0x10)
    

How it works...

In step 1, you determine the location of the latest release of the font and set a variable to the location to download the font.

In step 2, you use Invoke-WebRequest to download the font archive. Then in step 3, you use Expand-Archive to expand the archive. Finally, in step 4, you install the Cascadia font.

The steps in this recipe produce no console output – but you can see the change in VS Code after you run these steps.

There’s more...

In step 1, you determine the location of the latest release of the Cascadia Code font on GitHub. The font is heavily used and has been subject to minor updates and improvements over time. This step ensures you get the latest version. The remaining steps expand the downloaded archive and then install the font. Once you complete this recipe, you should observe the font inside VS Code.

In step 2, you download the latest version of the font – but as a ZIP archive, which, in step 3, you expand and then install (in step 4).

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