You might know the more.com tool: when you pipe output to more.com, the output is displayed page by page: PS> Get-EventLog -LogName System | more...
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
Creating Your Own Get-Driver Tool
Some code snippets are really valuable, so you should turn them into functions to keep around as new PowerShell commands. Here's a sample...
Finding More Driver Information
In a previous tip you learned how you can convert raw CSV data from a console application such as driverquery.exe into real PS objects. Let's...
Finding Driver Information
driverquery.exe returns all kinds of information about installed drivers, but the information seems a bit useless at first: PS> driverquery.exe...
Finding Standard Parameter Names
In a previous tip, we suggested you to use standard parameter names for your own functions. To get a feeling for what the parameter names are that...
Best Practice for PowerShell Functions
This is a best-practice message: when you create your own function, here are some things you should consider: - Function name: use cmdlet naming...
Adding New Lines to Strings
In a previous tip you learned that text arrays can easily be multiplied. The same is true for assignment operators such as +=. When you apply this...
Creating Multiline Strings
You probably know what this line produces: 'Hello' * 12 Right, you get 12 times the string you submitted. If you wanted new lines instead, a...
Enumerating Registry Keys
To enumerate all subkeys in a Registry key, you might be using a line like this: PS> Dir...
Asking for Credentials
When you write functions that accept credentials as parameters, add a transformation attribute! This way, the user can either submit a credential...
How to List Registry Hives
Use the provider name instead of a drive name when you need to get a list of all registry hives: Dir Registry:: ReTweet this Tip!
Writing Registry Key Default Values
If you need to set the default value for a registry key, you can use either of these approaches: Set-ItemProperty -Path HKCU:\Software\Somekey -Name...
Use Dumping Help
You can start by dumping all Help information into a file to learn more about a PowerShell cmdlet. You can then read all details about the cmdlet...
Use Out-GridView Requirements
Out-GridView is a great way to present results in a “mini-Excel” sheet: Get-Process | Out-GridView However, Out-GridView has two...
Use the CTRL+Arrow
Inside the PowerShell console, you can hold CTRL while pressing the arrow key to move the cursor word-by-word. This way, you can move the cursor...
Change Service Start Mode the PowerShell Way
When you list services with Get-Service, you will find that a lot of properties may seem to be missing. You can still set such properties when you...
Change Service Startmode
You can use WMI like this if you want to change a service start mode: ([wmi]'Win32_Service.Name="Spooler"').ChangeStartMode('Automatic').ReturnValue...
Determining Service Start Modes
By using WMI, you can enumerate the start mode that you want your services to use. To get a list of all services, try this: Get-WMIObject...
Print All PDF Files in Folders
Try this one-liner if you need to print out all PDF documents you have stored in one folder: Dir c:\myfolder\*.pdf | Foreach-Object { Start-Process...
Store Pictures in Active Directory
When you need to store a picture into an AD account, the picture will have to be converted to byte values before it can be stored. Just make sure...
Finding IP and MAC address
When you query network adapters with WMI, it is not easy to find the active network card. To find the network card(s) that are currently connected...
Turning Multi-Value WMI Properties into Text
When you read multi-valued information from WMI or any other source, for example, network adapter IP addresses, this information is returned as a...
Finding Network Adapter Data Based On Connection Name
Sometimes it would be nice to be able to access network adapter configuration based on the name of that adapter as it appears in your network and...
Creating Excel Reports from PowerShell Data
Provided you have Microsoft Excel installed, here is a clever function that you can use to convert PowerShell results into Excel spreadsheets:...
Outputting Text Reports without Truncating
If you want to capture PowerShell results in a text file, you can redirect the results or pipe them to Out-File. In any case, what you capture is...
Turning SIDs into Real Names
Sometimes, you'd like to turn security identifiers (SIDs) into real names. Here is a function that can do this for you: function SID2Name($sid){...
Converting User Names to SIDs
If you want to translate a valid user name to its security identifier (SID), here is a function to do that for you: function Name2SID($name,...
Changing Units
When you list folder contents, file sizes are in bytes. If you'd rather like to view them in MB or GB, you can use calculated properties, but by...
Closing Excel Gracefully
When you access Microsoft Excel from script, you may have noticed that it never gets removed from memory again, even if you call its Quit() method:...
Formatting Currencies
Formatting numbers as currencies is straight-forward - as long as it is your own currency format: '{0:C}' -f 12.22 If you want to output...