Simple PowerShell to get a Computer’s Specification

With Black Friday and Christmas fast approaching, I’m getting a lot of requests for people to help with computer upgrades or even whole new PCs.

Normally the first question you need answered is what do they have already, but this can sometimes not be straight-forward to a non-technical person.

Me: “What kind of PC do you have now?”

Them: “Sort of beigey-white? Eggshell maybe?”

We’re mid-pandemic so going round to have a look isn’t an option and my intricate multi-page documents about how to go to get each piece of info (with screenshots!) were still too technical.

So, PowerShell to the rescue.

Continue reading “Simple PowerShell to get a Computer’s Specification”

PowerShell: Tutorial 2, “Teach a Man to Fish” or Working Out The Command You Need

A series of tutorials, or How To Get Started With PowerShell:  “It’s Awesome” edition.

The title was originally built around “Teach A Man A Cmdlet and he PowerShells for a day;  Teach a Man to Use Get-Command and he PowerShell’s for a lifetime.”  But it got more and more clumsy and convoluted so I finally decided that there really was a limit to my own cleverness.

PowerShell really is quite clever though and makes it really easy to work out the cmdlets you want to use for any task. Continue reading “PowerShell: Tutorial 2, “Teach a Man to Fish” or Working Out The Command You Need”

PowerShell: Synchronizing a Folder (and Sub-Folders) Part 9

Hi. Here’s another update on the Sync-Folder script. The script itself is at that link but in this post I go over the changes I made and how they work.

The main addition is the support for -WhatIf (so you can test the script runs without it making changes).  In addition I fixed some odd bugs with the Filter and Exceptions parameters.  Plus some more Verbose logging and I tidied up the script a bit (removing some of the cmdlet aliases and replacing them with the full commands). Continue reading “PowerShell: Synchronizing a Folder (and Sub-Folders) Part 9”

PowerShell: Tutorial 1, Everything is an Object

A series of tutorials, or How To Get Started With PowerShell:  “It’s Awesome” edition.

When I thought about what I considered the most important, fundamental thing to learn about PowerShell I went through a couple of options;  Piping?  The help system and Get-Command?  -WhatIf?

All useful things to learn, but for me it has to be how everything in PowerShell is an object.  It’s how you can build Really Cool Stuff from lots of simpler parts.

Continue reading “PowerShell: Tutorial 1, Everything is an Object”

PowerShell: A Simple Batch Processing System, Part 1

batchHi.  I’ve written a few scripts that have gotten to be quite large.  In all cases they’ve needed to make a series of changes to a set of objects and log the results.  It’s normally important that some of the later changes only get made if the earlier ones are successful;  for example only changing the default SMTP address on a mailbox if another SMTP address was added earlier.

This series of posts will go into a decent system I’ve found for accomplishing this with some skeleton examples that are (hopefully!) easy to adapt. Continue reading “PowerShell: A Simple Batch Processing System, Part 1”