In a previous tip you learned how to use the string method EndsWith() to check whether a text ends with certain characters. This method does not...
database-tools
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
Checking if a Text Ends with Certain Characters
You can always use the String method EndsWith(). Just make sure you convert the text to lower-case first to avoid case-sensitive comparison. This...
Counting Log Activity Based On Product Install
In a previous tip you learned how to use Group-Object to analyze text-based log files. Here's a refined snippet. It will count on which days...
Counting Log Activity
Did you know that Group-Object can analyze text-based log files for you? Here's sample code that tells you how many log entries on a given day a...
Shrinking Paths
Many file-related .NET Framework methods fail when the overall path length exceeds a certain length. Use low-level methods to convert lengthy paths...
Output to Console AND Variable
To assign results to a variable and at the same time view these results in your console, place the assignment operation into parenthesis: ($result =...
Converting to Signed Using Casting
In a previous tip, you learned how to use the Bitconverter type to convert hexadecimals to signed integers. Here is another way that uses type...
Chapter 20. Loading .NET Libraries and Compiling Code
Since PowerShell is layered on the .NET Framework, you already know from Chapter 6 how you can use .NET code in PowerShell to make up for missing...
Converting to Signed
If you convert a hex number to a decimal, the result may not be what you want: PS> 0xFFFF 65535 PowerShell converts it to an unsigned number...
Getting Timezones
Here's a low level call that returns all time zones: PS> [System.TimeZoneInfo]::GetSystemTimeZones() Id : Dateline Standard Time DisplayName...
Chapter 19. User Management
Chapter 18. WMI: Windows Management Instrumentation
Chapter 17. Processes, Services, and Event Logs
In your daily work as an administrator, you will probably often deal with applications (processes), services, and event logs so let’s take some of...
Chapter 16. Managing Windows Registry
Mapping Printers
To map a network printer to a user profile, here's a powerful low level command: rundll32 printui.dll,PrintUIEntry /in /n...
Chapter 15. Working with the File System
Fun with Date and Time
Get-Date can extract valuable information from dates. All you need to know is the placeholder for the date part you are after. Then, repeat that...
Chapter 14. XML
In today’s world, data is no longer presented in plain-text files. Instead, XML (Extensible Markup Language) has evolved to become a de facto...
Counting Work Days
Ever wanted to know how many days you need to work this month? Here's a clever function that lists all the weekdays you want that are in a...
Chapter 13. Text and Regular Expressions
Converting to Hex
Here's a simple way to convert a decimal to a hex representation, for example, if you want to display an error number in standard hexadecimal...
Chapter 12. Managing Scope
Anything you define in PowerShell - variables, functions, or settings - have a certain life span. Eventually, they expire and are automatically...
Sending Variables through Environment Variables
Let's assume you want to launch a new PowerShell session from an existing one. To carry over information from the initial session, you can use...
Chapter 11. Error Handling
Chapter 10. Scripts
PowerShell can be used interactively and in batch mode. All the code that you entered and tested interactively can also be stored in a script file....
Chapter 9. Functions
Showing MsgBox
Ever wanted to display a dialog box from PowerShell rather than spitting out console text? Then try this function: function Show-MsgBox { param (...
Chapter 8. Loops
Loops repeat PowerShell code and are the heart of automation. In this chapter, you will learn the PowerShell loop constructs. Topics Covered:...
ASCII Table
Here’s a simple way of creating an ASCII table through type casting: 32..255 | ForEach-Object { 'Code {0} equals character {1}' -f $_, [Char]$_ }...
Chapter 7. Conditions
Conditions are what you need to make scripts clever. Conditions can evaluate a situation and then take appropriate action. There are a number of...