Browsed by
Category: Blog

Expiring Group Membership

Expiring Group Membership

As a systems administrator working with Active Directory your probably proficient in granting access to network resources. How good are you at removing permissions once the access is no longer needed? Probably not as good. Enter Expiring Group Membership in Active Directory. You can specify how long an object belongs in a group. Active Directory handles the removal for you. To use Expiring Group Memberships, make sure that the feature is enabled in your forest. This is a feature added…

Read More Read More

Get-Command -Syntax vs Get-Help

Get-Command -Syntax vs Get-Help

Wait, is Get-Help or Get-Command right? At the PowerShell Summit 2015 I witnessed Lee Holmes state that Get-Command is always the better way to look up the syntax of a cmdlet. What did he mean by that? Get-Help and Get-Command are two of the only three cmdlets you need to know. The other being Get-Member. Why do you need both Get-Command AND Get-Help?

Random Man Page in PowerShell

Random Man Page in PowerShell

PowerShell is a programming language and console application that comes with “batteries included”. The help system and documentation is built in. Granted, it arrives in an outdated form for built-in modules and requires an Update-Help to be complete. A man page is crucial for understanding commands in Linux. One of the ways I learn new technology is to read the man page. It isn’t the most efficient way to learn, I prefer a combination of books and video training, but…

Read More Read More

PSGitLab v3.0.1 Released

PSGitLab v3.0.1 Released

A ton of work went into the v3 version of PSGitLab, both on my part and that of the community. There are new contributors as well as familiar names in the changelog and I am thankful for all of the help. My goal of releasing an open source project to help others has been greatly exceeded by the contribution of those in the PowerShell community. Over the next few months, I hope to make it easier for new contributors to jump in and add coverage to the GitLab API.

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