Windows laptops (and servers, too) can get hot, especially during summer. Surprisingly, there is no simple built-in way in Windows to monitor...
ps1
Get German Holidays
Here is a PowerShell function that gets all German holidays, either nationwide or just for your state: function Get-GermanHoliday { param (...
Finding Start Time Degradation
With Administrator privileges, a Windows system provides access to the diagnostic data gathered during startup. Windows logs the start time and...
Microsoft Graph PowerShell Community Sample Page
Microsoft Graph is a new unified programming model to manage cloud services such as Microsoft 365 and Azure. Many PowerShell modules and cmdlets...
Identifying AD Accounts without Proper Encryption Type
You may have accounts (inc. trust accounts) in AD that have a null value for msds-SupportedEncryptionTypes. They may have been working "by accident"...
Managing File Shares
Creating a new file share for your network requires Administrator privilege and this PowerShell code: $Parameters = @{ Name = "Packages" Path =...
Masked Input
To safely enter input, scripts need to display a masked input. The easiest way to do this is to use Read-Host -AsSecureString: # Read-Host $entered...
Automating Control Panels
Windows Control Panel is the GUI center for any system configuration. You can launch control panel via console command, too: control [ENTER]....
Easily Transition to Get-WinEvent
Avoid Get-EventLog
Get-EventLog is a highly popular cmdlet in Windows PowerShell. With just a few simple parameters, it reads event logs from the primary Windows event...
Zodiac Calculator (aka “Sternzeichen”)
Ever wanted to automatically convert dates to zodiacs? Here is a fascinatingly simple script that can do it for you, both in English and German:...
Composing Dates from a DateTime
Here is a simple and generic way to turn DateTime information into just the ISO string data components you require. For example, if you just need...
PowerShell Script Won’t Run Without Confirmation
When you right-click any PowerShell Script in Windows, the context menu sports the command “Run with PowerShell”. However, when you do, you may see...
Choosing Best File Format (Part 4)
In the previous parts, we reviewed different file types to persist data and cmdlets to read and write them. Today, let’s apply this to a real-world...
Choosing Best File Format (Part 2)
PowerShell supports a wide variety of text file formats, so what’s the best way to save and read data? This largely depends on the type of data, so...
Identifying Multi-Language Online Documents (Part 2)
How can you automatically check the supported languages for an online document? Provided the URL uses a language ID, it’s easy to create a list of...
Careful with Arrays
Careful with Arrays With PowerShell you never know whether a cmdlet returns an array or a single object. That’s because PowerShell automatically...
Creating New Code Signing Test Certificates
PowerShell comes with a cmdlet named New-SelfSignedCertificate which can create all kinds of self-signed test certificates. However, it is not...
Get Volume IDs (Part 2)
In Windows 10 and better, you can use Get-Volume to get volume IDs and other information about your drives: PS> Get-Volume DriveLetter...
Get Volume IDs (Part 1)
You can query WMI to get a list of your drives volume IDs like so: Get-CimInstance -ClassName Win32_Volume | Select-Object -Property DriveLetter,...
Asking for Masked Input (Part 2)
Never ever use plain-text input for secrets and passwords – the text entered by the user may be logged and compromised. Always use a masked input....
Finding MSI Product Codes (Part 2)
On Windows 10 and better, finding MSI packages and their product codes no longer requires WMI queries. Instead, you can use Get-Package: Get-Package...
Finding MSI Product Codes (Part 1)
If you need a list of installed MSI packages and their product codes, you can use WMI to query the information. This may take a couple of seconds:...
Using HTML to create PDF Reports (Part 3)
HTML can be a simple way of formatting data for output reports. In this last part we illustrate how you convert the final HTML report to PDF...