This article was originally posted on the IpSwitch.com blog. The PowerShell scripting language has been called “automation glue” more times than I can count. It’s a fitting description if you’ve worked with it a lot. You may get the automation part of the title right away if you’ve merely heard of PowerShell and what it can do but the “glue” part may leave you wondering why. PowerShell was born at Microsoft and thus was built for Microsoft Windows.
One of the aspects of managing a Windows environment I try to be vigilant on is ensuring my clients are installing patches. With the recent exploits that occurred this year, I am certain this is an important aspect of my job. If I have Windows clients that are not installing […]
The post Finding outdated WSUS clients with PowerShell appeared first on WinSysBlog.
As your library of scripts and automation grows, everything you do will start to depend on your common datasets. Datasets like your user information or server details. Just think about how many scripts and tools you already have that either get a list of servers or you provide it a...
This article was originally posted on the IpSwitch.com blog. In this PowerShell tutorial, we will cover a few ways to interactively prompt a user for input. PowerShell is a powerful scripting language that can get a lot done, but it’s not telepathic. Unless you provide instructions for what you need to be done in your script, PowerShell’s not going to know if you meant file path A, file path B, a virtual machine named DC or if you want to really shut down an entire data center.
Sometimes you need to add more than one parameter set to a function you’re creating. If that’s not something you’re familiar with, it can be a little confusing at first. In the following example, I want to either specify the Name or Module parameter, but not both at the same time. I also want the Path parameter to be available when using either of the parameter sets. Taking a look at the syntax shows the function shown in the previous example does indeed have two different parameter sets and the Path parameter exists in both of them.
dbachecks is a new PowerShell module from the SQL Server Community! For more information, read introducing dbachecks. If you don’t know dbachecks, we have released a good amount of blog posts that will help you: Announcing dbachecks – Configurable PowerShell Validation For Your SQL Instances by Rob Sewell introducing dbachecks – a new module from … Continue reading dbachecks R
For the last couple of months, members of the dbatools team have been working on a new PowerShell module called dbachecks. This open source PowerShell module will enable you to validate your SQL Instances. Today it is released for you all to start to use 🙂 dbachecks launch – the blog posts series Here you … Continue reading dbachecks – Using Power BI dashboards to analyse r
Just recently I was running optimization job on S2D pool, so lead by curiosity I wanted to start it with the “-whatif” witch, like this: I have found it on this wonderful blog: http://www.darrylvanderpeijl.com/storage-spaces-direct-needs-rebalance/ And guess what? It started to do the job… So be aware about that once “testing” the Optimize-StoragePool cmdlet. Advertis
This article was originally posted on the IpSwitch.com blog. As an IT professional or manager, when you think of the word “script,” what comes to mind? Are images of VBScript and batch files still haunting you to this day? Are you just thinking about a nice, little piece of code that automates some mundane task? If so, let’s get you introduced to a Windows PowerShell script. In this article, we’re going to uncover many of the different ways you can use PowerShell for things other than just a “scripting upgrade” from VBScript and batch files.
First and foremost, HTML is not regex friendly. You should not try to parse HTML in PowerShell, or using regular expressions unless you’ve lost some kind of bet or want to punish yourself for something. PowerShell hasRead More...
Reading the wonderful series on Azure Multi-Factor Authentication (MFA) by Sander Berkouwer gave me the idea of sharing a PowerShell
function that allows you to enable this feature for a single user or multiple users. The ability to automate enabling MFA is very
powerful for configuring all users the same way. Not having to do this through the GUI also saves valuable time.
4sysops article conti
This article was originally posted on the IpSwitch.com blog. Before the days of PowerShell Test-NetConnection, we had many different command-line tools we could choose from to troubleshoot various network connectivity issues. We had ping for testing ICMP echoes and replies; tracert to see where our packets might be getting dropped; nslookup to perform DNS queries against our DNS servers; telnet to check for open TCP ports; and various other utilities.
First off, I have to say, the first two posts in this series have been very successful. Nearly 200 visitors on a Saturday and then a Sunday, too — that’s unheard of during the weekend. And to think, these two posts: Part I and Part II, have felt like some of the most distracted and […]
SquareSpace has been my blogging platform of choice since 2011. My biggest complaint with the platform has always been syntax highlighting. SquareSpace comes with some simple highlighting, but it only supports a few languages, certainly not PowerShell. Over the years I've tried everything from simply using bold and italic text, to using custom HTML and even embedded Pastebin and GitHub Gists. No matter what I tried, I was never happy with the result.
Part 2In Part 1 I gave an overview of the Peanut Butter and Chocolate Project. In Part 2 I will cover the required PowerShell modules for the deployment, the settings used in the project, authenticating tp Azure and AWS, deploying the Azure Function App, and Deploying the AWS CodeCommit repository. I also demonstrate how to verify the resource deployments with Pester.As a reminder, you can obtain the project code from https://github.
This article was originally posted on the IpSwitch.com blog. On Aug. 18, Jeffrey Snover finally got his wish. It was a wish that we in the PowerShell community knew was eventually coming judging from his tongue-in-cheek responses when asked about it for many months. Windows PowerShell was renamed simply to PowerShell because Windows was no longer its only supported operating system. It was now available on Linux and Mac OS X and, even better, it was completely open source, meaning that anyone could contribute directly to the project from a Github repository.
Source: 1981 Reese's Peanut Butter Cup AdvertisementIntroThis blog series will cover a Proof of Concept (POC) Project for creating a PowerShell-based Azure Functions CI/CD pipeline where the code is stored in AWS CodeCommit git-based version control system. The pipeline will be created and deployed using Windows PowerShell 5.1. Every step of the pipeline deployment process will be verified with Pester tests.
This is part 2 of the REST API blogpost. In part1 we successfully setup two REST API endpoints using the UniversalDashboard PowerShell module. In this part we are going to create a simple module that support some CRUD operation against our API. As we are trying to keep things as simple as possible, we will not use any fancy framework (like Plaster) to build our module. We are also going to skip a very important step you should familiarize yourself with, Pester tests.
I’d like to continue with our productivity series by talking about to-do lists. There is a lot of ways to create a to-do list. Everyone has their different ways, some people write things down in a notebook, some people use an app, some people use Google Tasks, some people use their calendar as their to-do list, some people use their email inboxes as their to-do list. A to-do list is just generally any kind of place where you catch reminders of what you need to do.
I just released another major update to PSGraph. This release includes new keywords and helps unlock more features of Graphviz. These features will make it easier to build entity and data model diagrams. Index Index Release notes Record -ScriptBlock Row -Name Entity -Name -Property Show-PSGraph Pulling it together Closing remarks...
In Part I of this series, I was supposed to begin offering reasons as to why someone would want to stop writing scripts, and start writing functions. I got a bit distracted. Instead, we discussed making an easy, and mostly meaningless, function. The reasoning for this, was because I get this feeling that moving from […]
This article was originally posted on the IpSwitch.com blog. As we use PowerShell Toolmaking to automate more tasks, most of us eventually find ourselves reinventing the wheel. We write a script to do task X, another to do task Y, then task Z comes around. A few weeks go by and we begrudgingly write another script to do task X again. This is because scripts have traditionally been treated as disposable.
This article was originally posted on the IpSwitch.com blog. PowerShell 5.x is soon being replaced. Once the official version of PowerShell Core 6.0 is deployed into production, we can get more details about the future. When Microsoft introduced Bash on Windows, it triggered a huge debate about whether the company would continue with PowerShell. However, Microsoft announced that although Bash and PowerShell differ in their focus and design, both are here to stay.
I have a function in my MrToolkit module named New-MrScriptModule that creates the scaffolding for a new PowerShell script module. It creates a PSM1 file and a module manifest (PSD1 file) along with the folder structure for a script module. To reduce the learning curve of Plaster as much as possible, I’m simply going to replace that existing functionality with Plaster in this blog article. Then moving forward, I’ll add additional functionality.
As I transitioned from the reactive firefighting of traditional IT to the more thoughtful world of DevOps, my work became more and more cognitively demanding. As a result, I quickly got burnt out and my ‘outside of work’ activities suffered. I simply had nothing left to give, which prevented me from being the husband, father, and friend I wanted to be. Not to mention the extra workload I put on myself when authoring a course, writing blog posts, etc… I felt like I was running on empty all the time.
Over the years I have developed different PowerShell modules for different web APIs. I thought it would be a good idea to write a 2 series post about how you could go about to do this. This will be a 2 part blog series where we will run through the entire process of building a module for a REST API. I will try my best to keep this as simple as possible and leave more advanced stuff for a follow up post if the interest is there.
This article was originally posted on the IpSwitch.com blog. As part of this cloud transition, it’s important to realize that even though you can’t see a system it still needs to be managed. Let’s talk about PowerShell automation. These days, just about every CIO, IT manager and IT professional has his head in the cloud. Organizations have found that offloading various utilitarian services to the cloud allows them to focus more on delivering business value rather than just keeping the lights on.
When you double click a file in Explorer.exe, it automatically opens in its default program if it has one associated with its type. But did you know you can do the same thing using PowerShell? MostRead More...
Map of Azure Regions as of February 2018
I'm pleased to announce that my PowerShell for working with Azure’s public IP address listings now supports the new Azure Regions in France and Germany. This release, 0.9, introduces some minor breaking changes, needed to support the Germany regions.
Seriously. If you’re not writing PowerShell functions yet, it’s. time. to. begin. It’s been time. I’ve decided I should begin to compile some potentially influencing reasons why you’d want make this move. Additionally, I also thought that maybe we need to first, give those out there, that haven’t been doing it, a little push by […]
This article was originally posted on the IpSwitch.com blog. With companies moving services to the cloud, applications offering robust APIs and a driving need for automation, we need a more mature scripting language. Some scripting languages are designed for one purpose and one purpose only. VBScript and batch files were used to automate small tasks. These languages were meant to offer a helping hand with various ad hoc tasks solely on local Windows systems.
If you’re like me, you try to automate everything through the PowerShell console. Automate employee account creation, easy. Check the registry on 500 remote servers, wouldn’t break a sweat. How about delegating your script to a junior systems administrator or maybe a help desk technician? That isn’t so easy. You have to trap errors, sanitize inputs, and generally guide the user through documentation.
The example code I’m going to include below, I’ve used before. I really like it and so I’m going to give it place here on my website, in case it may ever be helpful for you, and maybe even me again. The first time I used something like this code example was for a function […]
Wer mit Eigenschaften (Properies) von Objekten in PowerShell weiterarbeiten möchte, speichert diese meist in einer extra Variable. Dabei bietet die PowerShell mit den Subexpressions eine doch einfachere Lösung. Hier kann durch das voranstellen eines $-Zeichens direkt auf das die Eigenschaft … Weiterlesen →
Here we go again. I just rescued another draft post, fixed it up enough to share, and published it. Again, this was one of those posts that just never made it past my drafts for one reason or another. I think I figured out what I wasn’t doing correctly, so I’m ready to hand it […]
Have you seen this!? Help us Recognize Amazing PowerShell Contributors! PowerShell.org has brought back their PowerShell recognition program of the past. This is a great opportunity to say thank you to people in the PowerShell community that may have helped you along your journey. Chances are, that we didn’t all get here entirely on our […]
In two weeks from now, on 23th of February, I will be speaking at SQLBits 2018! It’s my first time on the largest SQL Server conference in Europe for data professionals. I will deliver a session about SQL Server Reporting Services and PowerShell titled – “Administrating SSRS without boring web based clicks”. You can check … Continue reading I will be speaking at SQL Bits
The new edition of PowerShell
v6.0, is out and generally available. Along with that, PowerShell is now cross-platform. This means if you write PowerShell scripts you can expand your client base, your reputation and your bank account.
There’s No Free Rides
With great power, comes great responsibility. Consider this, you’re currently writing a cool PowerShell script or module, and you’ve developed it on and for PowerShell v5.
As PowerShell Core begins to spread into our world, and as we start thinking about working and scripting cross-platform, it will be useful to know what type of platform you are running on. The built in $PSVersionTable is an obvious place to start. On PowerShell Core there are also some new built-in variables you can […]
You’ve implemented Azure AD Connect to synchronize accounts in your on-premises Active Directory environment to Azure AD. If you took the defaults while running the setup wizard for Azure AD Connect, then everything in your Active Directory environment is synchronized. If you decided to filter the synchronization later to only specific OU’s (Organizational Units) in your Active Directory environment, you could run into a scenario where the number of deletions exceeds the default threshold of 500 objects.
I’m in the middle of a project that requires me to read over existing PowerShell scripts and provide edits. This means I need to add error checking, remove unnecessary duplication, and break down lengthy scripts into tighter, singled purposed functions. After breaking down the first script into three functions and therefore concerned we’re going to […]
There has been a nasty rumor going around that EBS volumes no longer need initialization (formerly pre-warming). The Amazon page that talks about this mentions that it is no longer needed, but that it IS needed for EBS volumes created from snapshots.
Although custom and Amazon AMIs are stored as snapshots, many people I talk to have come to believe that EBS volumes simply don’t need initialization, no matter what.
I’ve published a new version of the myTasks module to the PowerShell Gallery and its GitHub repository. The big change is that the current version has a feature to send you a daily email with tasks that are due in the next three days. I’ve added a command called Enable-EmailReminder that will create a scheduled […]
Credit for this article is given to Tome Tanasovsk for this post regarding the same topic – https://powertoe.wordpress.com/2012/01/23/powerbits-7-copying-and-pasting-a-list-of-computers-into-a-powershell-script-as-a-collection/ Every now and then I will need to copy and paste data from Excel or a textfile straight into a PowerShell session in order to process it in some way. For instance, retrieving the […]
The post Copy and paste Excel data into a PowerShell collection appeared first on WinSysBlog.