When you export Microsoft Excel spreadsheets to CSV files, Excel by default saves CSV files in ANSI encoding. That's bad because special characters...
When you export Microsoft Excel spreadsheets to CSV files, Excel by default saves CSV files in ANSI encoding. That's bad because special characters...
If you have a CSV file and would like to change the order of columns, simply import it into PowerShell, use Select-Object to change the order, and...
In a previous tip we explained how you can use slmgr, a built-in VBScript, to check Windows licensing state. Accessing the Raw Licensing Data in...
Extracting the Integer Part of a Division Result When you divide numbers and just want the decimals before the decimal point, you could cast the...
Removing multiple white spaces from text is easy in PowerShell. -replace operator Simply use -replace operator and look for whitespaces ("\s") that...
Send Emails with PowerShell Using Send-MailMessage PowerShell has built-in support for sending emails: Send-MailMessage! All you need is an SMTP...
Reading Text Files and Skipping Blank Lines To read in a text file and skip blank lines, try this: $file = 'c:\sometextfile.txt' Get-Content $file |...
Set the default value for a registry key If you need to set the default value for a registry key, you can use either of these approaches:...
PowerShell hash tables PowerShell hash tables are, by default, not case sensitive: PS > $hash = @{} PS > $hash.Key = 1 PS > $hash.keY = 2...
Dealing with 32-bit Dependencies in a 64-bit Environment If you are using code that can only run in a 32-bit environment (i.e. using old database...
When working remotely in a peer-to-peer or cross-domain scenario, you will have to add all the computers you'd like to communicate with into the...
Understanding the Limitation of Hash Tables Compared to Switch Statements In the previous tip, you used a hash table to translate input values....