In the previous tips you learned how you can create a self-signed code signing certificate, save it to a PFX file, and read it back into memory....
ps1
Loading Certificates from PFX Files
In the previous tip we illustrated how you can use New-SelfSignedCertificate to create new code signing certificates, and store them as a PFX file....
Creating Self-Signed Code Signing Certificates
If you’d like to digitally sign your scripts, the first thing you need is a digital certificate with the designated purpose set to “Code...
Using LDAP Filters in Active Directory
LDAP filters resemble the query language used by Active Directory, and if you have installed Microsoft’s RSAT tools, you can easily use the...
Comparing Computer Data Received from PowerShell Remoting
PowerShell remoting is a very fast way to query multiple computers because PowerShell remoting works in parallel. Here is a real world use case that...
Generating MD5 Hashes from Text
The Get-FileHash cmdlet can generate hash codes for file content. It cannot generate hash codes for arbitrary text, though. And it is available only...
Finding File Duplicates
In the previous tip we explained how the Get-FileHash cmdlet (new in PowerShell 5) can generate the unique MD5 hash for script files. Hashes can be...
Creating MD5 File Hashes
MD5 file hashes uniquely identify file content and can be used to check whether file content is identical. In PowerShell 5, there is a new cmdlet...
Creating Balloon Tips Safely
Inspired by an article by fellow MVP Boe Prox, below you’ll find a sophisticated function that creates balloon tip dialogs. You can find...
Creating Leading Zeros
Did you ever need to convert numbers into strings with leading zeros, for example to compose server names? Simply use PowerShell’s...
Demystifying Error Handling
Any error in PowerShell code surfaces as an error record object. Check out the function below which extracts all relevant error information from...
Determine Boot Time and Uptime Remotely
Get-CimInstance is a useful cmdlet to retrieve WMI information because it uses standard .NET DateTime objects rather than the awkward WMI datetime...
Determine Boot Time and Uptime
WMI can tell you when a system was booted, and this information can be re-calculated to find out the uptime: $bootTime = Get-CimInstance -ClassName...
Pipe Information to Excel
Here is a small yet very useful function that receives data from other cmdlets and sends them to Excel: function Out-Excel { param( $path =...
Evaluating Event Log Information
Get-EventLog provides access to the content written to the classic Windows event logs. The most valuable information can be found in a secret...
Converting Weird Data Formats
Sometimes, you stumble across weird data formats, i.e. in log files, that won’t autoconvert to DateTime objects. Here is a quick approach for...
Finding All Domain Controllers (no module required)
In the previous tip we explained how you can use the ActiveDirectory module and its cmdlets to find all domain controllers in your organization, or...
Find All Domain Controllers
If you have installed the free Microsoft RSAT tools, you have access to the ActiveDirectory module. Here is a simple approach to find all domain...
Free Ebooks from Microsoft
Microsoft is giving away unlimited numbers of free ebooks on many different topics. Ebooks can be downloaded using a PowerShell script. Here are the...
Changing Network Connection Mode from Private to Public (and vice versa)
Starting with Windows Server 2012 R2 and Windows 8.1, PowerShell ships with many useful cmdlets for client and server configuration. This comes...
Removing Windows 10 Apps
PowerShell is probably the easiest way to get rid of preinstalled Windows 10 apps. If you know the name of a particular app that you want to remove,...
Launching Daily Tools via Alias
You probably know the shortcut names that PowerShell predefines: Aliases like “dir” and “ls” help you save typing in...
PowerShell 2 Now Considered Deprecated
Microsoft just announced that PowerShell 2 will soon be labeled “deprecated”. It will still be available for some time, but this is a...
Repairing Disk Drives
In the old days, disk repair was performed by chkdsk.exe. This still works. In Windows Server 2012 R2 and Windows 8.1, a new cmdlet called...