Import a Module from Other Computers

Import a Module from Other Computers

PowerShell comes with a simple way to install a module using PowerShellGet and the Find/Install Module cmdlets. Did you know however that you can import modules, over the network, from a computer that already has them installed? They aren’t installed locally and when you run the commands, PowerShell will seemlessly run them in the PowerShell process running on the remote computer. I am constantly hopping onto different computers at work and not all of the computers have the RSAT tools…

Read More Read More

Git Commit Messages and Hooks

Git Commit Messages and Hooks

Maintaining integrity in your code is hard. Git hooks are an easy way to manage your workflow so you never commit code that doesn’t meet your standards. How do you know if the changes you made introduced bugs? Testing of course. Do you know if your code follows best practices? To figure that out, you’d use a linter. In PowerShell the community uses Pester for testing and PSScriptAnalyzer for making sure you follow community standards. Git hooks let you validate…

Read More Read More

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