This is where I put all my general purpose powershell scripts/tutorials
How to best organize powershell code? In this tutorial I describe the problems with organizing code, how to solve it without modules, and finally how to do it better with modules.
Introduction to Powershell Modules
Immutable objects are great, but hard to do in Powershell. With only 3 short functions, we can create immutable arrays, hashtables, simple types (string, int, ...) and convert custom object to be immutable too.
Immutable objects in powershell 5
When creating a powershell GUI, it's quite tricky to have the GUI not freeze up while a called function is running. To combat this, I've created a handler function that will run a powershell job and processes GUI events while the job is running.
GUI with which you can get all groups a user is member of (directly or indirectly), and/or all the users that are member of a group (directly or indirectly), up to a given depth.
When browsing long filepaths, the ISE prompt can get pretty longwinded and fill up the entire row. This profile will rewrite the titlebar to show the user, whether you're elevated as that user, and the filepath.
Takes ServiceName, Computer list, login credential Script tries to log in to every computer in the computer list using the given Credential It then tries to restart the service using Invoke-Command.
This script might be improved by just giving the entire computer array to the invoke-command cmdlet. One would have to figure out how to do the errorhandling well then.
RestartServiceOnMultipleComputers
With this script, you can define the proper access control list on a template folder, and apply it to any destination folder, while preserving whatever extra ACE's there might be on that destination folder.
This function can be used to crawl a folder down to all the subfolders and get a total size of the folder Especially useful for network shares that don't show the folder size in the properties.
For my work, I sometimes have to create a certain kind of load on a system to test monitoring. Have a look in LoadSimulation to see what kinds of loads I have scripts for.