CloudFormation YAML: EC2 Instance with PowerShell UserData

Someone recently was asking for an AWS CloudFormation template, in YAML format as opposed to JSON, that would deploy an EC2 instance running Windows Server, and supported a PowerShell-based UserData script. In response to this, I created the YAML snippet below. Note that the Amazon Machine Image (AMI) ID is …

Continue reading

Restore Default PowerShell Gallery Repository

If you’ve accidentally deleted the PowerShell Gallery (PSGallery) repository from your system, you can restore it using the following command. Register-PSRepository -Default In fact, if you try to re-register the PowerShell Gallery using the same method that you’d register a custom repository (see below) … $Repository = @{ Name = …

Continue reading

Retrieve AWS AccountID using PowerShell

As an AWS customer writing programs against AWS service APIs, using the AWS Tools for PowerShell, you’ll often need to reference your AWS AccountID. For example, some service API calls require passing in an Amazon Resource Name (ARN), which contains your AWS AccountID as one of its parts. Much of …

Continue reading

Change VSCode Integrated Terminal to PowerShell

Visual Studio Code :: Integrated Terminal Setting

Visual Studio Code is an excellent developer tool for PowerShell projects. However, regardless of which type of project you’re developing (C#, Node.js, Python, etc.), you can benefit from changing your default shell to the powerful, object-oriented PowerShell shell. Now, you may not want to change your default shell for the …

Continue reading

Why I use Visual Studio Code to write PowerShell

Visual Studio Code - PowerShell Extension

A Little History on PowerShell Editors Since 2009, PowerShell users have been rewarded with an improvement over Notepad, for authoring PowerShell scripts and modules. That tool is called the PowerShell Integrated Scripting Editor (ISE), which was originally included out-of-box with Windows 7 and PowerShell version 2.0. Over the years, PowerShell …

Continue reading

Write PowerShell Modules, not Scripts

Write PowerShell Modules, Not Scripts

When you think of PowerShell, is writing a PowerShell “script” one of the first things you think of? If so, I implore you to read on and think about the next time you write any PowerShell code. During the rest of this article, I’ll attempt to describe a gap I’ve …

Continue reading

Add Voice to Your Node.js Application with Amazon Polly

This week has certainly been an exciting one, especially in the cloud IT market! Amazon Web Services (AWS) just recently announced a really cool, new service called Amazon Polly! AWS Polly is a speech synthesis (text-to-speech) service, aimed at software developers and architects, that enables you to generate speech from …

Continue reading

Use PowerShell to Copy Files over WMI

Scenario Recently, a question came up on StackOverflow, about PowerShell, where someone wanted the ability to copy a file to a remote system via Windows Management Instrumentation (WMI). The question went on to clarify that the individual did not want to have any dependency on SMB (Server Message Block) shares, …

Continue reading

Run PowerShell Natively on Linux and Docker!

Microsoft just made a huge splash today, by announcing that PowerShell is now available on Linux! I created a launch video that demonstrates how to get PowerShell Core running inside a Docker container! You can see the video over on Microsoft’s MSDN Channel 9. https://channel9.msdn.com/Shows/msftazure/Run-PowerShell-Natively-on-Linux-with-Docker Check if PowerShell is Running …

Continue reading