Enable PowerShell remoting on ArcoLinux

PowerShell is a cross-platform scripting language that runs on Windows, Linux, and macOS. ArcoLinux is a rolling release Linux distribution based on Arch Linux. Prerequisites ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option. The examples shown in this article were performed using Xfce Terminal. ArcoLinux was fully updated using the sudo pacman -Syu command. Installation Verify that you have PowerShell installed: pwsh --version If you receive the error: command not found, see Install PowerShell on ArcoLinux to install PowerShell.

Install the Hugo Static Site Generator on ArcoLinux

Hugo is a lightning-fast open-source static site generator that’s written in Go. ArcoLinux is a rolling release Linux distribution based on Arch Linux. Prerequisites ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option. The examples shown in this article were performed using Xfce Terminal. ArcoLinux was fully updated using the sudo pacman -Syu command. Installation I downloaded version 0.89.4 of Hugo extended. For the latest version or a different version, see the Hugo GitHub repo.

Install Visual Studio Code (VS Code) on ArcoLinux

Visual Studio Code (VS Code) is a powerful, lightweight, and cross-platform source code editor. ArcoLinux is a rolling release Linux distribution based on Arch Linux. Prerequisites ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option. The examples shown in this article were performed using Xfce Terminal. ArcoLinux was fully updated using the sudo pacman -Syu command. Installation You could use the pacman or paru command. I chose to use the pamac command.

Install PowerShell on ArcoLinux

PowerShell is a cross-platform scripting language that runs on Windows, Linux, and macOS. ArcoLinux is a rolling release Linux distribution based on Arch Linux. Like other Arch-based Linux distributions, ArcoLinux uses pacman for its package manager. Prerequisites ArcoLinux was installed using the ArcoLinuxL ISO with the easy installation option. The examples shown in this article were performed using Xfce Terminal. ArcoLinux was fully updated using the sudo pacman -Syu command.

Use PowerShell to determine the Windows version on DVD, ISO, or USB installation media

You’re preparing to load an operating system. You find installation media for an unknown version of Windows. It’s not labeled. How do you determine the version of Windows on the installation media? You can use the Get-WindowsImage cmdlet to determine the Windows version of installation media. This cmdlet is part of the Dism PowerShell module. It can be used with Windows PowerShell 5.1 and PowerShell 7 on Windows operating systems.

Using the conditional ternary operator for simplified if/else syntax in PowerShell 7

The conditional ternary operator is a feature added to PowerShell in version 7. You can use it as a simplified version of if/else. The syntax for the ternary operator takes three operands: A condition to evaluate followed by a question mark (?). An expression to execute if the condition is true, followed by a colon (:). And finally, an expression to execute if the condition is false. <condition-to-evaluate> ?

Formatting PowerShell 7 code like Kusto Query Language

An obscure feature that was added to PowerShell in version 7 is the ability to specify the pipe character on the next line similar to the syntax for Kusto Query Language (KQL). Get-Command -Name Get-Help, Get-Command, Get-Member -PipelineVariable results | Select-Object -ExpandProperty ParameterSets | Select-Object -ExpandProperty Parameters | Where-Object Aliases | Select-Object -Property @{label='CmdletName';expression={$results.Name}}, Name, Aliases | Sort-Object -Property CmdletName, Name -Unique | Format-Table -GroupBy CmdletName Pasting code in the PowerShell console with pipes at the beginning of lines only works when using Ctrl+V.

Format the output of a string in multiple columns with PowerShell

In my previous blog article, I used the PowerShell Format-Wide cmdlet to format the output of a string in multiple columns. While Format-Wide isn’t a command that I’ve used extensively, the behavior wasn’t what I expected. When you pipe object-based output other than a string from any PowerShell command to Format-Wide, it produces the desired results. Get-PSDrive | Format-Wide -Column 2 I’ll pipe the following to Get-Member to confirm that it’s a string.

Use the Abstract Syntax Tree (AST) to list parameters and variables in PowerShell functions

One thing I’ve missed during the past couple of years with virtual-only conferences is the hallway track. While at the PowerShell + DevOps Global Summit 2022, there was a discussion about using PascalCase for parameter names and camelCase for user-defined variables in your PowerShell functions. Specifying different casings depending on the usage seems like a great idea. Determining where you defined your variables would be self-explanatory. The only problem is you need something to verify that you’ve specified them in the correct case.

Use the Abstract Syntax Tree (AST) to inspect PowerShell command syntax in scripts

I recently needed to determine the PowerShell commands and parameters used in multiple scripts. What better way to accomplish this task than to use the Abstract Syntax Tree (AST)? The Get-MrSyntax function begins by requiring at least PowerShell version 3.0. This is the oldest version that exposes the AST. The Path parameter uses ValidateScript for parameter validation to only accept files with a PS1 or PSM1 extension. The path(s) to the script files can be specified via pipeline or parameter input.

Video: Automatically Migrate your Scripts from AzureRM to the Az PowerShell Module

As many of you know, I’m a Senior Content Developer for Azure PowerShell at Microsoft. Today we announced the Az.Tools.Migration PowerShell module which is a toolkit for automatically migrating your PowerShell scripts and modules from AzureRM to the Az PowerShell module. The video shown below demonstrates how to use this module: For more information, see the official announcement that I wrote on the Microsoft Tech Community blog site. In addition to the PowerShell module, there is also a VS Code extension for performing the migration.

How many Services does Microsoft Azure Offer?

How many service offerings does Azure have? I’ve read anywhere from 150 to 600 and I even went so far as to ask an Azure Product Manager but didn’t receive a clear answer. What I did find out is that Microsoft maintains an Azure services directory on their Azure products website. I figured that was a good place to start looking and while the website is informative, it didn’t provide a count of the service offerings.

AzureRM PowerShell Commands that Don’t Exist when Enabling Compatibility Aliases in the Az Module

On Twitter, I asked if anyone was still using the AzureRM PowerShell module and what was keeping them from transitioning to the Az PowerShell module. One of the responses I received was because of the amount of work and time invested in scripts based on the AzureRM module. The Az PowerShell module includes compatibility aliases for scripts written using the AzureRM PowerShell module. The compatibility aliases are enabled using the Enable-AzureRmAlias command.

How to Install the Azure Az PowerShell Module

The Az PowerShell module was released in December of 2018 and is now the recommended module for managing Microsoft Azure. AzureRM is the previous PowerShell module for managing Azure which has been deprecated but will continue to be supported until February of 2024. Windows PowerShell 5.1, PowerShell Core 6, PowerShell 7, and higher are supported by the Az PowerShell module. Windows 10 version 1607 and higher has Windows PowerShell 5.1 installed by default.

Setting Dependencies on the Azure PowerShell Module

I recently saw a tweet from Joel Bennett about the Az (Azure) PowerShell module being nothing more than an empty module that imports all of the modules for each Azure product. I decided to investigate. Get-Content -Path (Get-Module -Name az).Path | Select-String -SimpleMatch 'Import-Module' Joel’s statement is 100% accurate. Off-Topic: The searched for term is highlighted in each result when the previous command is run in PowerShell 7.

Initial Setup of a CanaKit Raspberry Pi 4 4GB Starter Kit

For Christmas, I received a CanaKit Raspberry Pi 4 4GB Starter Kit with Clear Case (4GB RAM). The kit contains everything you need minus an HDMI monitor and USB keyboard/mouse. It includes the Raspberry Pi 4b (I received the one with 4GB of RAM, but it’s also available with 1GB or 2GB of RAM), heatsinks, a power supply with a removable inline switch, case (I ordered the one with a clear case), case fan, micro HDMI to HDMI cable, micro SD card with NOOBS preinstalled (I ordered the one with a 32GB card), and a USB micro SD card reader in case you need to reload NOOBS on the SD card.