New-Item can create new things on any PowerShell drive, including the function: drive that holds all PowerShell functions. If you’d like, you...
ps1
Categories
- Free tools
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- 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
Identifying Windows Type
Launching PowerShell Scripts Invisibly
There is no a built-in way to launch a PowerShell script hidden: even if you run powershell.exe and specify -WindowStyle Hidden, the PowerShell...
Get-ComputerInfo vs. systeminfo.exe (Part 1)
For a long time, the command-line utility systeminfo.exe provides a wealth of information about a computer and can return object-oriented results...
Simple PowerShell Chat
Here’s a fun PowerShell script that you can use to create a simple multi-channel chat room. All you need is a network share where everyone has...
Converting SecureString to Text
It can be very useful to be able to convert an encrypted SecureString back to a plain text. This way, for example, you can use PowerShell’s...
Embedding Binaries (Pictures, DLLs) in PowerShell Scripts
If your script requires external binary resources such as picture files or DLLs, you can of course ship them together with your script. You could,...
Using Awesome Export-Excel Cmdlet (Part 5)
This is part 5 of our mini-series about the awesome and free “ImportExcel” PowerShell module by Doug Finke. Make sure you install the...
Converting HTTP Response Codes
In the previous example we created a small PowerShell function that checks web site availability, and as part of the test results, a HTTP response...
Finding Hidden PowerShell Applications
The most widely known PowerShell hosts are certainly powershell.exe and powershell_ise.exe because they ship out-of-the-box. However, there can be...
Using Pop-up Dialogs that Are Always Visible
In the previous tip we used an old COM technique to display a pop-up box with a built-in timeout. That worked pretty well except that the dialog box...
Using Session Variables in Web Requests
Sometimes, web requests that work fine in a browser do not seem to work well in PowerShell. For example, when you navigate to...
Using FileSystemWatcher Asynchronously
In the previous tip we looked at the FileSystemWatcher object and how it can monitor folders for changes. To not miss any changes, however, an...
Finding PowerShell Named Pipes
Each PowerShell host running PowerShell 5 or better opens a “named pipe” that you can detect. The code below identifies these named...
Using a Queue instead of a Recursion
Rather than calling functions recursively, you may at times want to use a Queue object that you can load with fresh tasks while you are unloading...
Locking the Screen with PowerShell
Here is a PowerShell function called Lock-Screen that can lock the screen and prohibit user interaction. There can be a custom message, and the...
Passing Arguments to Encoded Commands
Encoding PowerShell code is a great way to run PowerShell code outside the PowerShell environment, i.e. in batch files. Here is some sample code...
Deleting Registry Keys that can’t be Deleted
Deleting registry keys is typically trivial and can be done with Remove-Item. However, every once in a while, you may come across registry keys that...
Splitting Large Files in Smaller Parts (Part 1)
PowerShell can split large files in multiple smaller parts, for example to transfer them as email attachments. Today, we focus on splitting files....
Using Custom Prompts for Mandatory Parameters
When you define mandatory parameters in PowerShell, the user gets prompted for the value if it is missing. The prompt uses the parameter name only...
Calculating Most and Least Significant Byte
Numbers are stored internally as bytes. An Int32 value, for example, uses four bytes. Sometimes it is required to split up the number into its byte...
Create ASCII Art
It’s amazing how versatile PowerShell is: with just a couple of lines of code, you can turn any photo and image into a piece of ASCII art....
Verifying Local User Account Passwords
In the previous tip, we asked Active Directory to validate user account passwords. The same can be done with local accounts. Your PowerShell code...
Converting Text to Image
WPF (Windows Presentation Foundation)is not just a technique to create UIs. You can create any type of vector-based graphics composition and save it...