Posts tagged with "PowerShell"
Fun with Certificates
Disect certificates for fun and profit.
My PowerShell Journey
How my career changed by learing powershell
Monitoring Cron and Scheduled Tasks With Healthchecks.io
Keeping an eye on web servers that stop serving pages or hard drive that fill up are monitoring basics.
Expiring Group Memberships
Take advantage of the new AD feature of expiring group memberships
Logging PowerShell Scripts
As you progress from running commands at the console, to scripting tedious work, to automating entire processes you still need to keep an eye on whats running. Nobody likes figuring out what went wrong on in a process by debugging your script. You should integrate logging into any scripts that run unattended. Logging saves time […]
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. […]
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 […]
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 […]
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 seamlessly run them in the PowerShell […]
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 […]
Poor Man’s GUI
Write a quick UI around your PowerShell function
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 […]
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 […]
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 […]
Generate Random Passwords
Whether you’re at a help desk resetting passwords or setting up service accounts, you always need to be able to generate good random passwords. You know, the kind nobody wants to type more than once. The correct horse battery staple method popularized by XKCD is where you string together four words to create passwords with […]
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.
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 […]
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 […]
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 […]
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 […]
Generic Pester Tests
Writing good Pester Tests is hard. Use your PowerShell knowledge to make things easier with Generic Pester Tests. Module Testing There are many requirements for module manifest to work everywhere. You need a root module to load your .PSM1, you need a version number so PowerShell knows which version to load into the console at […]
Export to Excel
If you handle any sort of data in your job you’ve likely run into the common PowerShell cmdlets for dealing with data; Import-CSV, Export-CSV, Import-CliXML, and Export-Clixml. Sometimes, automation requires the processing of data. CSV and XML are both great ways to store and send data. The only thing is, no human chooses to manipulate […]
Installing Modules
Whether you’re writing scripts, functions to automate a repetitive task, or building a whole toolkit you should be familiar with installing modules. Modules let you group functions in a logical way. Creating a bunch of functions that automate part of your Active Directory environment? Group them all into a module. Modules help by letting you […]
Time Your Script with Timespan Objects
Speed and consistency are the two main reasons people automate tasks using PowerShell. Give your script the same inputs and it should produce the same outputs. The consistency concept is easy. What about how much time is saved using PowerShell? We can achieve this using the Timespan object built into PowerShell. Start and Stop Times […]
Why Use Source Control
Source control, whether you’re writing one off scripts or automating intricate processes, is essential to your work. Simply keeping copies of your files scattered across your computer is not good enough. Source control will save you when you can’t figure out what changes you made that caused errors, when you can’t find the current version […]
Turn Off PSReadline
Beginning with Windows Management Framework 5 Microsoft decided to ship Pester and PSReadline baked into the framework. Pester is a testing framework and PSReadline is a handy utility that brings some bash functionality to the PowerShell console. PSReadline brings syntax highlighting and amazing multi-line editing to the console and I don’t know if I could […]
PSPushover
I just recently published a module to the PowerShell Gallery called PSPushover and it couldn’t have been easier. Pushover.net is an alerting service I use to notify me of different events through IFTTT and I wanted a way to send off alerts from my PowerShell scripts. Some of my scripts are long running and I’d […]
Pipelines and Objects
Two strong points of PowerShell are the ability to work with Pipelines and Objects. PowerShell is built on top of .NET and has the ability to work with .NET objects as well as sending and receiving information from the pipeline. Objects To developers, asking them to go from an object based language to one that […]
Get Involved in PowerShell
I got a secret for you. The PowerShell community needs your voice. Your perspective on things. You might think that the community has enough talented people out there but you’d be wrong. It is time to get involved. The truth is, PowerShell has gotten big. Really big. It now covers the console shell, desired state […]
Formatting Output
Formatting output from cmdlets doesn’t have to be complicated. PowerShell ships with cmdlets that can take the output from other cmdlets and display the information in a pretty way. Format-Custom, Format-List, Format-Table, and Format-Wide are the ways to present data at the console. Out-Default Out-Default is a cmdlet you likely have never heard of but […]
Introduction to Cmdlets
For years Microsoft has played a trick on systems administrators. They convinced you that you could administer Windows Servers at the same scale that Linux administrators could. While that sentiment is true the tooling wasn’t always geared towards system administrators. You had MS-DOS and batch files that you could use to automate anything you could […]
Introduction: PowerShell Direct
PowerShell Direct is a new feature to Windows Management Framework version 5 that allows for Windows hosts to run PowerShell commands against a Hyper-V guest. Think of this as PowerShell Remoting without the need to enable remoting on the guest operating system. Your guest doesn’t have to configure the firewall to allow for remoting. You […]
Credentials
Have you ever tried running a script only to find that your user account doesn’t have the proper rights? You could start up another PowerShell session using the ‘Run as Different User’ option but wouldn’t you rather a PowerShell way? There is. PowerShell offers the PSCredential object type that allows you to store and retrieve […]
Beyond Syntax: Pester Testing
A TechSession episode where we discussing going beyond the easy stuff in pester.
PowerShellGet Introduction
With PowerShell version 5 Microsoft released a way of installing modules using PowerShell. Before v5 you would have to copy modules into specific folders where the module folder name has to be exactly has the module .psd1 file. Getting it right for someone who wasn’t writing modules was hard. I know at work I would […]
Why Write About PowerShell
In one word: Community. I’m one of those IT Pros who entered IT without formal training. I have no degrees in any of the IT related disciplines, I am almost completely self taught. I excelled in the field due to my ability to find solutions to problems online and in my confidence that if I […]