In the previous tip we created new code-signing test certificates both as pfx file and located in your certificate store. Today, you’ll see...
Powershell
Categories
- Free tools
- SQL Admin Toolset
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- SQL Doctor
- SQL Enterprise Job Manager
- SQL Inventory Manager
- SQL Query Tuner for SQL Server
- SQL Safe Backup
- SQL Secure
- SQL Workload Analysis for SQL Server
- Uptime Infrastructure Monitor Formerly Uptime
Code-Signing Mini-Series (Part 1: Creating Certs)
To play with digital signatures, and discover how you can sign scripts and modules, you first need a code-signing certificate. If you can’t get one...
Converting SecureString to Clear Text
Secure string content cannot be easily viewed: $password = Read-Host -Prompt 'Your password' -AsSecureString PS C:\> $password...
Using Catalog Files
Catalog file support (.cat) is new in PowerShell 5.1. Cat files basically are file lists with hash values. You can use them to ensure that a given...
Making Error Records More Readable
Whenever PowerShell encounters an error, it emits an Error Record with detailed information about the problem. Unfortunately, these objects are a...
Creating Write-Protected Functions
PowerShell functions by default can be overridden anytime, and you can also remove them using Remove-Item: function Test-Lifespan {...
$FormatEnumerationLimit Scoping Issues
As shown in the previous tip, the secret $FormatEnumerationLimit variable determines how many array elements are shown in output before the output...
Displaying Array Members in Output
When you output objects that have arrays in their properties, only 4 array elements are displayed, then an ellipsis truncates the rest: PS C:\>...
Find All Files Two Levels Deep
Yet another file system task: list all *.log files in a folder structure, but only to a maximum depth of 2 folder structures: Get-ChildItem -Path...
Deleting All Subfolders Below A Given Level
Here is another file system task that sounds worse than it actually is. Let’s say you need to remove all folders below a given level in a...
Deleting All Files from a Folder Structure
Sometimes tasks sound worse than they actually are. Let’s say you need to clear a folder structure and remove all files, leaving empty...
Adding RSS Ticker to PowerShell Title Bar
A new PowerShell background thread can do things for you in the background, for example updating your PowerShell window title bar with new news...
Invoke-WebRequest vs. Invoke-RestMethod
Invoke-WebRequest simply downloads the content from any web site. It is then your job to read the content and make sense of it. In the previous tip...
Downloading PowerShell Code
In the previous tip we explained how Invoke-WebRequest can be used to download the raw HTML content for any web page. This can also be used to...
Hiding Progress Bars
Sometimes, cmdlets automatically display a progress bar. Here is an example of such a progress bar: $url =...
Analyzing Web Page Content
PowerShell comes with a built-in web client which can retrieve HTML content for you. For a simple web page analysis, use the -UseBasicParsing...
Adding Extra Safety Net
If you are writing PowerShell functions, and you know a particular function has the potential to cause a lot of harm, there is an easy way of adding...
Hiding Common Parameters
In our last tip we explained how you can hide parameters from IntelliSense. This has a cool side effect that we’d like to point you to today!...
Turning Objects into Hash Tables
In one of the previous tips we examined how Get-Member can retrieve the property names for an object. Here is another use case that takes any...
Hiding Parameters
In the previous tip we explained how you can dump all the legal values for a PowerShell attribute. Today we’ll take a look at the [Parameter()]...
Exploring PowerShell Attribute Values
As you might know, you can add attributes to variables and parameters to more specifically define them. For example, the line below defines a...
Using Dynamic Parameters
Most PowerShell functions use static parameters. They are defined in a param() block and are always present. A little-known fact is that you can...
Accessing Website Content
Typically, it is trivial for PowerShell to retrieve raw HTML website content by using Invoke-WebRequest. A script can then take the HTML content and...
Accepting Different Parameter Types
Occasionally, you might want to create a function that accepts different parameter types. Let’s say you want the user to be able to either submit an...
Translating VBScript to PowerShell
Most old VBS scripts can be easily translated to PowerShell. The key command in VBS is “CreateObject” which lets you access system libraries....
Invoking Excel Macros from PowerShell
PowerShell can invoke Microsoft Excel sheets and start contained macros. While this would work with an invisible Excel application window, it is a...
Programmatically listing any Cmdlet or Function Parameters
Ever wondered how you can list all properties exposed by a function or cmdlet? Here is how: Get-Help Get-Service -Parameter * | Select-Object...
Examining Object Properties Programmatically
Whether you import a CSV list into PowerShell using Import-Csv, or deal with any other type of objects: how can you automatically determine the...
Accessing Hidden (Private) Member
[System.Management.Automation.ModuleIntrinsics _i="0" _address="0.0.0.0" theme_builder_area="post_content"...
Performance (Part 3): Faster Pipeline Functions
In previous tips we illustrated how you can improve loops and especially pipeline operations. To transfer this knowledge to functions, take a look...