Poor Man’s GUI

Poor Man’s GUI

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. After all that, trust that you’re underling knows their way around the console. Maybe you need a…

Read More Read More

Using ThreadJob for Performance

Using ThreadJob for Performance

Parallelizing work in PowerShell has been a drag. Runspaces are too complicated to spin up and background jobs are too resource intensive. There is a parallel foreach parameter when using workflows but I’ve never been able to figure workflows out. I’ve always used Invoke-Parallel and PoshRSJob to accomplish most speed related tasks but now there is a new module in town. The PowerShell team has just released to the PowerShell Gallery a new module called ThreadJob to handle spinning up…

Read More Read More

Deploying PowerShell Down-level

Deploying PowerShell Down-level

There have been many great features added to PowerShell throughout the years.  Lots of new cmdlets come through the Remote Server Administration Tools (RSAT) or baked into the new version of the operating system. Some features we’re deemed so important that they were back-ported to older operating systems like Windows 7. Remember that Windows 7 came with Windows Management Framework (WMF) 2 so updates are definitely needed. The best PowerShell experience is still going to be using the latest Windows…

Read More Read More

PowerShell Core 6.0 Released

PowerShell Core 6.0 Released

PowerShell Core 6.0 has been released thanks to the hard work of the PowerShell Team. It is a stripped down version of PowerShell that runs cross-platform. That means PowerShell for Linux, MacOS, and even ARM based devices. All new development will go into PowerShell Core so it is time to jump on the bandwagon and get involved. If you run into issues make sure to report them. If you’re interested in proposing big changes check out the PowerShell-RFC to submit…

Read More Read More

Adding Updates to a Wim File

Adding Updates to a Wim File

Even with Microsoft releasing new Windows 10 builds on a twice-yearly basis, there is still a case to be made to slipstream updates into your install media. First, you never have to worry about whether your computer gets needed patches. If you build in protection against the Wanna Cry malware by patching MS17-010 you can. Second, it saves a decent amount of time during computer provisioning. No need to push down the original copy of a file as well as…

Read More Read More

Never Lose Your Work at the Console

Never Lose Your Work at the Console

If you’re like me, every once in a while you have a dash of brilliance, write the perfect one-liner, but forget to record your work. You know you solved this problem already, but none of your documentation bears witness. You’re a trapeze artist without a safety net when you work at the console. Now, between transcripts, saving previous output, and HistoryPX, you won’t have to worry. Transcripts Transcripts are exactly what you think they are. They are a character for…

Read More Read More

Tail a File in PowerShell

Tail a File in PowerShell

In my limited Linux administration experience I got used to dealing with text. Text documents that held configuration files, text manipulation in the pipeline, text everywhere. Every search was just a grep away. When troubleshooting in Linux you’re constantly reading log files. Checking for changes and seeing if your what you’re flushing comes out the correct pipe. A tool that made the job easier was the tail command with the -f argument. This allows you to follow whatever is appended…

Read More Read More

Update-ModuleManifest is Back

Update-ModuleManifest is Back

Starting with Windows Management Framework 5.1 PowerShell now comes with Update-ModuleManifest. This is after Update-ModuleManifest broke and was removed from WMF 5. WMF 5.1 has been added to Windows 10 build 14342 and can be installed using the fast ring. Note: If you’ve been relying on a wildcard to load all of your exported functions you may run into issues. See, using wildcards cause up to 15 seconds of lag when loading the module. The new Update-ModuleManifest now explicitly creates…

Read More Read More

How I Work: Pester Testing

How I Work: Pester Testing

Ever since the 2015 North America PowerShell Summit I’ve become addicted to Pester testing. I use it for Unit Testing as well as Operational Validation. Not only the Pester open source but it is actually included in Windows 10. The rumor at the summit was that this was the first open source software built into Windows. This is truly a new Microsoft. I also use Generic Pester Tests to make sure my code stays up to my standards. Exported functions…

Read More Read More