Mark Wragg avatar

TILFMOL #1 - The PowerShell Pipeline

2 days ago | Mark Wragg

A blog post about how PowerShell pipeline input binding works, getting input to a property without the pipeline and the concept of one script one pipeline.

Mark Wragg avatar

Learn PowerShell in a Month of Lunches

2 days ago | Mark Wragg

I got started with PowerShell thanks to the encouragement and enthusiasm of a friend and former colleague. Following that, I've largely developed my knowledge through the standard combinations of trial + error + googling and more recently (as is evident) by doing my best to engage with and give back to the

Mike Robbins avatar

PowerShell 101 Book Update: First 3 Chapters Now Available

2 days ago | Mike Robbins

Another update to my new book, PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell is now available. The update which was published this morning added chapter 3 to the already available first two chapters. If you’re interested in purchasing this book, consider buying it while it’s still a work in progress. The price of the book increases slightly with each chapter that’s released.

Doug Finke avatar

An Overlooked PowerShell Module For Generating Data

6 days ago | Doug Finke

Introduction This is a two part series about the PowerShell NameIT module, published on the PowerShell Gallery. Chris Hunt, co-contributor, has a companion post on his blog AutomatedOps. I came across a GitHub repo where Mitch Denny created a tool that is a simple tool to generate names and check them for availability. He wrote it in TypeScript and I was interested because of the template language he built to interact with the tool.

Jeff Hicks avatar

Check for Module Updates

7 days ago | Jeff Hicks

It seems to me that the topic of finding or detecting module updates on the PowerShell Gallery has gotten a lot of interest over the last few days. So I thought I’d contribute my bit of code to check currently installed modules against their online versions in the PowerShell Gallery. I have a PowerShell script … Continue reading "Check for Module Updates"

Mike Robbins avatar

PowerShell One-Liner to Disable Active Directory Accounts and Log the Results to a SQL Server Database

8 days ago | Mike Robbins

The new PowerShell cmdlets that are part of the SQLServer PowerShell module that’s distributed as part of SSMS (SQL Server Management Studio) 2016 make it super easy to write the output of PowerShell commands to a SQL Server database. The ActiveDirectory PowerShell module that’s part of the RSAT (Remote Server Administration Tools) is also required by the code shown in this blog article.

Sebastian Feldmann avatar

Backup HP ProCurve Switches via SSH, TFTP and PowerShell

9 days ago | Sebastian Feldmann

PowerShell Version: >4  Modules: Posh-SSH So, this is a pretty specific one! I have been tasked to backup old and new ProCurve Switches and of course I am using PowerShell for this 😉 I found a script about doing this via SFTP where you enable ip ssh filetransfer on the switches and get the files from there […] The post Backup HP ProCurve Switches via SSH, TFTP and PowerShell appeared first on blog.

Mathieu Buisson avatar

Unit Testing with Pester : storing complex Mock objects in a JSON file

10 days ago | Mathieu Buisson

When unit testing with Pester, mocking is pretty much unavoidable, especially for code related to infrastructure, configuration, or deployment. We don’t want our unit tests to touch files, a database, the registry, and not to mention the internet, do we ? With Pester’s Mock function, we can isolate our code from this outside (hostile ?) … Continue reading Unit Testing with Pester

Tore Groneng avatar

Serialize data with Powershell

13 days ago | Tore Groneng

Currently I am working on a big new module. In this module, I need to persist data to disk and reprocess them at some point even if the module/powershell session was closed. I needed to serialize objects and save them to disk. It needed to be very efficient to be able to support a high volume of objects. Hence I decided to turn this serializer into a module called HashData.Other Serializing methodsIn Powershell we have several possibilities to serialize objects.

Jeff Hicks avatar

NIC 2017 Slides and Demos

14 days ago | Jeff Hicks

Earlier this month I had the pleasure of presenting at the Nordic Infrastructure Conference (NIC). This is still a relatively young conference as these things go, but you couldn’t tell based on my experiences.  Given the demise of TechEd Europe, conferences like this are filling the void, and doing a fantastic job. The conference draws … Continue reading "NIC 2017 Slides and Demos"

Mike Robbins avatar

Managing Altaro VM Backup with PowerShell

15 days ago | Mike Robbins

Recently, I decided to try to determine if there was a way to manage Altaro VM Backup with PowerShell. I figured there must be some database, files, or something that I could at least query with PowerShell. What I found is Altaro has a RESTful API and they have numerous PowerShell scripts for working with it. In Altaro version 7, there are 33 PowerShell scripts located in the “C:\Program Files\Altaro\Altaro Backup\Cmdlets” folder if you took the defaults during the installation, otherwise they’re wherever you installed Altaro.

Honorary Scripting Guy Award

16 days ago | Thomas Rayner

Yesterday, Microsoft’s Ed Wilson announced the Honorary Scripting Guys for 2016. I am honored and very proud to be the newest Honorary Scripting Guy, joining this year’s repeat winners: Sean Kearney, Teresa Wilson, and Will Anderson.Read More...

Doug Finke avatar

PowerShell and Lucene

20 days ago | Doug Finke

Lucene.NET is . . . a full-text search engine written in C# open source https://github.com/apache/lucenenet PowerShell and Lucene In 2016, Bruce Payette (co-founder of PowerShell), presented at the PowerShell conference in Germany on Lucene.NET full text search engine with PowerShell. Intriguing Working from his example, in PowerShell I layered a WPF UI on top of the search engine. You can specify directories and patterns to do a full text index on like c:\posh\*.

Mike Robbins avatar

Video: PowerShell 101 – The No-Nonsense Beginner’s Guide to PowerShell

22 days ago | Mike Robbins

Last week, I announced a new book for PowerShell beginners that I’m self-publishing. I decided to create a short video about the book and cover the topics from Chapter 1. The video can also be found on YouTube.com The book (PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell) can be found on Leanpub.com. µ

Sebastian Feldmann avatar

Monitor scheduled Tasks using PowerShell and check_mk

22 days ago | Sebastian Feldmann

PowerShell Version: >1  Modules: none As I am focused on a new check_mk implementation there might be a lot of PowerShell/check_mk around here for a bit 😉 This time I wrote something to monitor the result of a scheduled task the oldschool way. With PowerShell >4 you can use the Get-ScheduledTask function as shown here but as I […] The post Monitor scheduled Tasks using PowerShell and check_mk appeared first on blog.

Jeff Hicks avatar

Creating a Github Gist with PowerShell

29 days ago | Jeff Hicks

Recently I posted a PowerShell tool for creating a GitHub repository. In continuing my exploration of the GitHub API I wrote another PowerShell tool to create a GitHub gist. A gist is simple way to store and share snippets or code samples. I use them to share simple PowerShell scripts or other works that aren’t … Continue reading "Creating a Github Gist with PowerShell"

Mike Robbins avatar

Announcing a new book: PowerShell 101 – The No-Nonsense Beginner’s Guide to PowerShell

29 days ago | Mike Robbins

I’ve contributed, co-authored, performed technical reviews and edits on a number of PowerShell books. I also speak to a lot of beginners at user group meetings and technology events such as PowerShell Saturday’s and SQL Saturday’s. One thing I’ve found is there are still a lot of IT Pro’s out there who are reluctant to learn PowerShell and they’re often overwhelmed by information overload when they do try to learn it.

Sebastian Feldmann avatar

Using PowerShell and check_mk to monitor Citrix Licensing Usage

one month ago | Sebastian Feldmann

PowerShell Version: >4  Modules: none   I just wrote a custom local check for check_mk to get the Citrix Licensing Usage checked. All you need to do is fill in the $license_server and maybe customize $percent_warning and $percent_critical. The check reads the licensing WMI and gives you OK / WARNING / CRIT in check_mk for the corresponding […] The post Using PowerShell and check_mk to monitor Citrix Licensing Usage appeared first on blog.

Jeff Hicks avatar

Storing PowerShell Credentials in JSON

one month ago | Jeff Hicks

Sometimes I do things in PowerShell just to see what happens. This is a great way to learn about new cmdlets and techniques. Sometimes these experiments lead to useful results. Other times they may end up as teaching devices. Of  course the result could serve both purposes and you may have to decide that today … Continue reading "Storing PowerShell Credentials in JSON"

Francis Setash avatar

PowerShell DSC - Pull Server Video Tutorial

one month ago | Francis Setash

While the video covers most of this material, here is the accompanying write-up. Let’s run through setting up a DSC Pull Server!

Mark Wragg avatar

Issue uploading Pester test results in to AppVeyor

one month ago | Mark Wragg

While experimenting with AppVeyor to add Continuous Integration to my PowerShell projects (more detailed blog post to follow) I encountered a bug that meant that the Pester test results (uploaded via the NUnit formatted results file) were not appearing in the "Tests" tab of my AppVeyor project. -- Update: The

Mark Wragg avatar

Create dynamic PowerShell functions with Parameter Sets

one month ago | Mark Wragg

While developing a PowerShell function to query the API of the webcomic XKCD I decided to explore and implement Parameter Sets. These allow you to provide your users with different sets of parameters based on different use cases (assuming you have multiple use cases), which as a result provides a

Invoking Pester and PSScriptAnalyzer Tests in Hosted VSTS

one month ago | Thomas Rayner

Overview Pester and PSScriptAnalyzer are both fundamental tools for testing the effectiveness and correctness of PowerShell scripts, modules, and other PowerShell artifacts. While it is relatively convenient and straightforward to run these tools on a localRead More...

Tore Groneng avatar

Something completely different – PoshARM

one month ago | Tore Groneng

I needed a project for my Xmas holiday and I needed something remotely work related. Thus the dubious PoshARM Powershell module was born and brought to life during my Xmas holiday. Simply put it is a module that lets you build – for now – simple Azure Resource Manager (ARM) templates with Powershell. The module can also import templates from a file or from the clipboard/string. Your partial template or ready made template can be exported as a Powershell script.

Jeff Hicks avatar

Creating a GitHub Repository from PowerShell

one month ago | Jeff Hicks

I’ve been continuing to work with the GitHub API in PowerShell. Today I have a function you can use to create a new GitHub repository. Of course you will need to have a GitHub account and another piece of critical information, but after that it is quite easy to create new repositories. This makes it … Continue reading "Creating a GitHub Repository from PowerShell"

Stephen Owen avatar

Adding tab-completion to your PowerShell Functions

one month ago | Stephen Owen

  This post is part of the series on AutoCompletion options for PowerShell! Click the banner for more posts in the series! Probably my single favorite feature of PowerShell isn’t exciting to most people…but I love Auto-Completion.  I have my… Continue reading →

Mike Robbins avatar

Beware of the PowerShell Update-ModuleManifest Function

one month ago | Mike Robbins

I recently presented a session for the Mississippi PowerShell User Group on PowerShell Non-Monolithic Script Module Design. While preparing for that session, I discovered that a problem I had previously experienced with Update-ModuleManifest when trying to update the FunctionsToExport section when FormatsToProcess is specified appeared to be resolved in PowerShell version 5.1 (I’m running build 14393).

Francis Setash avatar

Jenkins, Powershell DSC, and CI

one month ago | Francis Setash

DSC is truly one of my favorite things to come out of the PowerShell team to date. The power for idempotent infrastructure and deployment is great. However, one relatively minor roadblock is getting an MOF delivery pipeline in place for getting the MOF configurations to a pull server.

Mathieu Buisson avatar

Merging data from 2 PowerShell DSC configuration data files

one month ago | Mathieu Buisson

As you probably already know, when writing a DSC configuration, separating the environmental data from the configuration logic is a best practice. So all the environment-specific data gets stored in separate (typically .psd1) files. If you work with PowerShell DSC at medium-to-large scale, you (hopefully) have separate configuration data files for each customer and each … Continue reading Me

Mike Robbins avatar

Using PowerShell to Audit Antivirus Updates on your Servers

one month ago | Mike Robbins

How often do you check to make sure that things like antivirus has received the latest definition files on all of your servers? There’s probably some centralized GUI interface somewhere that you could log into and check. The antivirus product itself may even have some sort of notification system that sends alerts if the updates fail. Both of those options provide data in a format that can’t be worked with and what happens if something falls through the cracks? Are you willing to bet your job and possible the reputation of your company that some junior level engineer is monitoring those systems? While each antivirus product is different, it’s fairly simple to determine if the information for the antivirus product is stored somewhere such as in the registry where you can access it remotely with PowerShell.

Jeff Hicks avatar

PowerShell 6.0 Release Tools

one month ago | Jeff Hicks

As you should be aware, the next version of PowerShell is open source and cross-platform. You will be able to run PowerShell v6 on Windows, a Mac and select Linux distributions. All of the code is currently in alpha and hosted on the PowerShell GitHub repository. This is also where you can download new builds … Continue reading "PowerShell 6.0 Release Tools"

Mark Wragg avatar

Powershell Slack Bot using the Real Time Messaging API

one month ago | Mark Wragg

This post details how PowerShell and .NET can be used to run a custom Slack Bot that utilizes the Slack RTM (Real Time Messaging) API and Web Sockets.

Does A String Start Or End In A Certain Character?

one month ago | Thomas Rayner

Can you tell in PowerShell if a string ends in a specific character, or if it starts in one? Of course you can. Regex to the rescue! It’s a pretty simple task, actually. Consider the followingRead More...

Jeff Hicks avatar

Web Testing with PowerShell

2 months ago | Jeff Hicks

I run a self-hosted WordPress blog here as part of a hosted package.  I run this on a very tight budget so I’m pretty sure I share resources with other tenants. This means that sometimes the server is unavailable, usually for only a brief period of time. I have the JetPack WordPress plugin configured to … Continue reading "Web Testing with PowerShell"

Jeff Hicks avatar

A Classy Christmas PowerShell Module

2 months ago | Jeff Hicks

Yesterday I showed you a class-based PowerShell script. My intention was to have a little bit of fun and teach you the basics of using a class. But what I gave you was really just the first step. If you wanted to create an actual tool around a class, you will most likely want to … Continue reading "A Classy Christmas PowerShell Module"

Jeff Hicks avatar

A Classy PowerShell Christmas

2 months ago | Jeff Hicks

Well it’s that time of year again to have some holiday fun with PowerShell. This year I thought I’d give you a classy present. Or more accurately, a class-based PowerShell toy. Classes were introduced in PowerShell 5.0, primarily with DSC resources in mind, but you can use classes for all sorts of things. In simple … Continue reading "A Classy PowerShell Christmas"

Stephen Owen avatar

Registering for WMI Events in PowerShell

2 months ago | Stephen Owen

An alternate title might be ‘Running PowerShell Code ONLY when the power state changes’, because that was the very interesting task I received from my customer this week. It was honestly too cool of a StackOverflow answer NOT to share,… Continue reading →

Mike Robbins avatar

No PowerShell Cmdlet to Start or Stop Something? Don’t Forget to Check for Methods on the Get Cmdlets

2 months ago | Mike Robbins

Many PowerShell commands return output in the form of objects (some return nothing at all). An example of this is shown in the following example where properties and their corresponding values are returned. CommandType is a property and Cmdlet is the value for that particular property for each of the results: Keep in mind that what is shown in the default output may not be the actual property names (compare the default output from Get-Process to the properties listed from Get-Process | Get-Member for an example of this).

Mike Robbins avatar

Loop through a collection of items with the Pester TestCases parameter instead of using a foreach loop

2 months ago | Mike Robbins

One of the huge benefits of attending in-person technology events is getting to network with others. While at the MVP Summit last month I had a chance to demonstrate some of my PowerShell code and Pester tests to Jim Truher.  I was developing the code and tests for a session to present for the PowerShell Virtual Chapter of SQL PASS (the code and a video of that presentation can be found here). In one of my examples, I was looping through a collection of items (computer names of SQL Servers) to run Pester tests against each one using a foreach loop similar to what you’ll find in this blog article.

David O'Brien avatar

Building images on AWS with Packer - the new way

2 months ago | David O'Brien

Building custom images on AWS For a very long time people have built custom images for cloud consumption with the help of Packer. Packer is an open source tool that works across multiple platforms like Amazon Web Services (AWS) and Microsoft Azure. For just as long users on AWS relied for some customisation of those Elastic Cloud Compute (EC2) instances on a service being present called the EC2Config service.

Quick Tip: Validate The Length Of An Integer

2 months ago | Thomas Rayner

A little while ago, I fielded a question in the PowerShell Slack channel which was “How do I make sure a variable, which is an int, is of a certain length?” Turns out it’s not tooRead More...

Sebastian Feldmann avatar

Removing vCenter Snapshots with PowerShell and VMware vSphere PowerCLI

3 months ago | Sebastian Feldmann

PowerShell Version: >4  Modules: VMware vSphere PowerCLI While having issues with HP Data Protector and VMware backups I created a script that logs in to different vCenter Servers and checks for Data Protector Snapshots that are older than x and removes them. This script can easily be customized to suite your environment and needs. [crayon-58b0e6413456f623650388/] The post Removing vCenter Snapshots with PowerShell and VMware vSphere PowerCLI appeared first on blog.

Sebastian Feldmann avatar

Look for unused GPOs with PowerShell

3 months ago | Sebastian Feldmann

PowerShell Version: 4  Modules: GroupPolicy If you find yourself lost in the jungle of existing GPOs in your environment use some PowerShell to sort out the ones that might not be needed anymore. [crayon-58b0e641346cb565281826/] The post Look for unused GPOs with PowerShell appeared first on blog.feldmann.io.

PowerShell 10 Year Anniversary Code Golf Winners

3 months ago | Thomas Rayner

For the PowerShell 10 Year Anniversary, Will Anderson (@GamerLivingWill on Twitter) and I (@MrThomasRayner on Twitter) ran a three-hole code golf competition on code-golf.com, a site developed by fellow MVP Adam Driscoll. Here is the linkRead More...

Doug Finke avatar

Quickly Install PowerShell Modules from GitHub

3 months ago | Doug Finke

Challenge Not all PowerShell Modules are published to the PowerShellGallery, many are hosted on GitHub. Plus, many of the modules published to the gallery are also hosted on GitHub and in repo branches. PowerShell open source authors (like myself) have newer versions in source control that have not been promoted to the PowerShell gallery because they are not complete or fully tested. There needs to be an easy way to get the latest updates from the repo.

Mark Wragg avatar

A Slack Slash Command using Powershell Azure Functions

3 months ago | Mark Wragg

How to use an Azure Powershell Function to respond to a slash command in Slack. In this example I host a glossary of terms in Azure and query it from Slack.

Quick Script Share: Prompt To Copy File If It Already Exists

3 months ago | Thomas Rayner

By default, Copy-Item will overwrite a file if it exists, unless that file is marked Read Only (in which case you can use the -Force switch to overwrite the file). What if you want to only copyRead More...

Mark Wragg avatar

A Powershell cmdlet for looking up internal terms in a glossary

3 months ago | Mark Wragg

A Powershell cmdlet for querying a large CSV glossary of internal terms. The cmdlet returns formatted results or can pass the results down the pipeline.

David O'Brien avatar

Azure Functions - BYO PowerShell modules

3 months ago | David O'Brien

BYO PowerShell modules to Azure Functions The previous articles introduced you to Azure Functions and how it executes PowerShell code. This article will explain how Azure Functions can be extended by bringing your own PowerShell modules. As we have seen in this introductory article there are already a few PowerShell modules present in the Azure Functions runtime environment but especially when we have to be a bit more special then we quickly end up in a situation where we need access to custom modules.

Tore Groneng avatar

Giving a helping hand - Community power

3 months ago | Tore Groneng

PowerShell is getting increasing attention and gaining followers each day. That is a good thing in my book. I saw a tweet about Citrix OctoBlu automation where Dave Brett (@dbretty) was using it to save money with a PowerShell script (full post here) to power on and off VMs. I reached out to him and asked if he would like a little help with his PowerShell script. To my delight, he happily accepted and this post is about how I transformed his scripts to take advantage of the full power of The Shell.