Let's assume you have a variable with a negative value, and you'd like to make it a positive value. Here's a simple way: Basically, this...
posts
Determining Registry Value Data Type
PowerShell can read and write Registry keys and values easily, but there is no a built-in way to check the data type of a given value. To find out...
Creating Colorized Excel Output (Part 2)
In a previous tip, we illustrated how you can feed HTML data to Excel in order to create formatted Excel sheets. Today, we'll show you an easy...
Creating Readable CSV-and HTML-Output
When you convert PowerShell results to CSV or HTML output, you may have discovered that some properties don't display correctly. PowerShell...
Creating Colorized Excel Output
PowerShell can send data to Excel using CSV files easily. Here's a short script creating a list of running services and opening it in Excel...
Finding Unused Drive Letter
Here's a simple way of finding unassigned drive letters: If you just want any unused drive letter, pipe the result to Get-Random. This approach...
Using Bitwise Shift Operators
PowerShell 3.0 introduces two new operators to bitwise shift. You can use these, for example, to convert GB to MB or KB to GB: -shr 10 basically...
Preventing Debugging (Part 2)
In a previous tip we explained how you can tell PowerShell not to debug certain functions by adding a special attribute: function test {...
Adding Suggestions to PowerShell Console
Suggestions are little pieces of text that can appear next to a PowerShell error message to better explain what went wrong. Suggestions only work in...
Examining Certificates
Here's how you can pick a certificate from your certificate store. This line will return certificates that have "Tobias" in the...
Removing Certificate Plus Private Key
Starting with PowerShell 3.0, the certificate provider has become a lot more powerful. It can now easily delete certificates plus their associated...
Preventing Flashing Console Window
When you run a console command inside a non-console PowerShell host (like the ISE editor), there will be a flashing window, indicating that the host...