[AllowNull() _i="0" _address="0" theme_builder_area="post_content" /][AllowEmptyString() _i="1" _address="1" theme_builder_area="post_content" /]
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
Setting Environment Variables
PowerShell can set environment variables only in its process set, so these changes will not persist and are not visible outside of PowerShell. To...
Appending the Clipboard
PowerShell 5 introduces cmdlets to copy text to the clipboard, and paste it back: Set-Clipboard and Get-Clipboard. Set-Clipboard also supports the...
Deleting User Profiles
Whenever a user logs on to your computer, a user profile is created, and in the previous tip we explained how PowerShell can dump a list of user...
Managing User Profiles
["MYDOMAINUser01" _i="0" _address="0" theme_builder_area="post_content" /]
Running Commands on Multiple Computers in Parallel
Provided you have enabled PowerShell remoting (see our previous tips), you can easily run commands and scripts on many computers at the same time....
Accessing Remote Machines via PowerShell Remoting
[targetComputerName _i="0" _address="0.0.0.0" theme_builder_area="post_content" /][targetComputerName _i="1" _address="0.0.0.1"...
Playing with PowerShell Remoting
If you’d like to test-drive PowerShell remoting, you need to enable it at least on the target machine (the one you’d like to visit). For...
Loading and Saving Options in JSON Format
If you’d like to persist information in your script, you might want to save your data as an object in JSON format. Here is an example: #...
Joining Computers to a Domain
Execution Policy Override
If PowerShell won’t let you run a script, you may have to enable script execution first, for example like this: Set-ExecutionPolicy -Scope...
Formatting Text Output
If you’d like to nicely format output text, you may want to use a PSCustomObject and output it as a formatted list like so: $infos =...
Converting User Name to SID
If you’d need to find out the SID for a user name, here is a useful chunk of code that does the job: $domain = 'MyDomain' $username =...
Test-Drive PowerShell 6 – Side by Side
PowerShell 6 can be downloaded and run side-by-side with the official Windows PowerShell. If you’d like to test-drive it, head over to...
Displaying Data in a Grid View Window Vertically
Out-GridView always produces a table with one object per line: Get-Process -Id $pid | Out-GridView Occasionally, it would be more helpful to display...
Converting Information to Culture-Specific Text
If you’d like to format information to given culture standards, this is really simple by using ToString() and the appropriate target...
Converting Culture-Specific Information
Let’s assume you received data like numbers or date as text. Whenever information is reduced to text, you are challenged with culture-specific...
Understanding Text Conversions
There are many different ways how objects can be transformed into text. In case you sometimes get confused, here is a quick refresher. Take a look:...
Allowing PowerShell Script Execution – No Matter What
Execution policy can prevent scripts from running. It is designed to be a user preference setting, so you should always be able to change the...
Comparing String Lists
In a previous example we used HashSets to compare numeric lists, and find out which elements were found in both list, or in just one list. The same...
Comparing Numeric Lists
Often a script needs to find out whether two lists are the same, or which elements are missing from a list. Instead of investing much programming...
Tagging Objects Efficiently
Occasionally you see scripts that use Select-Object to append information to existing objects. This can look similar to the code below: Get-Process...
Creating New Objects Efficiently
Adding Single Line Comments in PowerShell ISE
In the previous tip we looked at command extensions for the good old PowerShell ISE. Here is another sample that adds the CTRL+K keyboard shortcut...
Toggling Comments in PowerShell ISE
The good old PowerShell ISE exposes some expandability connectors. If you’d like to toggle comments in selected text by pressing CTRL+K, for...
Converting Hash Tables to JSON
In previous scripts we worked a lot with hash tables, and even loaded them from .psd1 files. If you need the data in a different format, for example...
Reading Data from .PSD1 Files in PowerShell 5+
In a previous tip we introduced Import-LocalizedData to read in data stored in a .psd1 file. Starting in PowerShell 5, there is a new cmdlet named...
Reading Data from .PSD1 Files
There are many ways how a script can store data information. One is especially convenient. Here is the code: Import-LocalizedData -BaseDirectory...
Understanding .NET Type Name Variants in PowerShell
PowerShell can use .NET type names, for example to convert values to a given type. Frequently, scripts use a variety of formats to define .NET...
Minimalistic Error Handling
Error handling does not necessarily have to be complex. It can be as simple as checking whether the last command executed successfully: # suppress...