As such, .NET Framework is huge and full of stars, and it is not easy to discover interesting methods buried inside of it. You can use the next...
Month: October 2010
Running Programs as Different User
If you ever needed to run a program as someone else, you can use Start-Process and supply alternate credentials. When you do that, you should also...
Run Programs Elevated
If you have User Account Control (UAC) enabled, you may want to run a program elevated. That's easy using Start-Process and the -verb parameter....
Launching Programs and Keeping in Touch
Normally, when you launch a program from inside PowerShell, you will lose contact to it. However, by using Start-Process with the -passthru...
Translating Culture IDs to Country Names
Have you ever wondered what a specific culture ID means? Here is a nifty function that will translate a culture ID to the full culture name:...
Listing Available Culture IDs
Ever needed to get your hands on some specific culture IDs? Here is how you can create a list:...
Clearing Console Content
When you want to clear the console content, you probably use "cls" or Clear-Host. For some strange reason, the Clear-Host cmdlet really is...
Resetting Console Colors
While there are two paths for changing the console color, will you be able to revert back to the original settings once you set colors via...
Changing Console Colors
Like any other console window, PowerShell has 16 pre-defined colors that you can choose from to set background and foreground color. You can use two...
Working with Private Variables
PowerShell inherits by default variables downstream so subsequent scopes can "see" the parent variables. If you want to turn off variable...
Creating "Static" Variables
Static variables are accessible everywhere. They can be used to collect data from various scopes in one place. You can use a prefix for a variable...
Understanding Variable Inheritance
PowerShell variables are inherited downstream by default, not upstream. So any variable you create at a given scope is passed to any code you call...
Do You Use "Break"?
"Break" is a special keyword that you can use to exit loops and conditions prematurely. Have a look: Do { $pwd = Read-Host 'Enter your...
Change ErrorAction for Your Private Error Handling
When you handle errors yourself using Trap or try/catch, you should make sure that you set your ErrorActionPreference to "Stop" or specify...
Deleting Error Records
In a previous tip, you learned that "Continue" can skip code in a loop. Another scenario for using "Continue" is error handling....
Using ‘Continue’
You will find that "Continue" is a special instruction that you can use in loops to skip the remainder of a loop. This next loop returns...
Getting PowerShell Team Blog Topic Headers
In a previous tip, you learned how to use RegEx to scrape information from Web pages. It really is just a matter of finding the right...
Move Groups Of Tables
I've just started to use the Schema Designer feature, and whilst handy it is driving me mad as I can't see any way of moving a group of...
Scraping Information from Web Pages
Regular expressions are a great way of identifying and retrieving text patterns. Take a look at the next code fragment as it defines a RegEx engine...
MONyog MySQL Monitor 4.1 beta 1 Has Been Released
Changes (as compared to 4.02) include: Features: * Added a new interface for customizing helper functions. Any customization to helper functions and...
Download Web Page Content
Probably the easiest way of reading raw Web page content is using the Web client object. This will read the Web content of...
Write-Output is Picky
Assigning (multiple) return values with Write-Output works well, but you should keep in mind that Write-Output is picky and returns the exact thing...
Do You Know Write-Output?
When you leave data behind, PowerShell automatically returns it to the caller. This may create strange-looking code. With Write-Output, you can...