If you made changes to your profile script and want to see the changes that are in effect without having to close and restart PowerShell, you can...
Powershell
Create (and Edit) your Profile Script
Profile scripts are automatically executed whenever PowerShell launches. Your profile script is the perfect place to customize your PowerShell...
Enter-PSSession – Do’s and Dont’s
Enter-PSSession will let you switch your console input to a remote computer—if remoting is enabled on the target computer. Essentially,...
Get WebClient with Proxy Authentication
If your company is using an Internet proxy, and you'd like to access Internet with a webclient object, make sure it uses the proxy and supplies...
Strongly Typed Arrays
When you assign strongly typed values to an array, the type declaration will remain intact only as long as you do not add new array content: $array...
Create Files and Folders in One Step
Use New-Item like this when you want to create a file plus all the folders necessary to host the file: new-item -type file -force...
Running 32-Bit-Code on 64-Bit Machines
Some code may not work right on 64-Bit machines. Use this approach to make PowerShell execute code in an isolated 32-Bit PowerShell session and hand...
Get Notification When a Background Job is Done
When you assign long-running commands to a background session, you may want to get some notification when the job is completed so you don't have...
Running Commands in the Background
You can also transfer commands into another PowerShell session and run it in the background. This will find all log files recursively in your...
Escaping Spaces
You should remember that spaces are special characters in PowerShell, too. They are token delimiters, and once you feed arguments to a native...
Why Native Commands Fail In PowerShell
You probably already know that not all native commands work equally well in PowerShell. Have a look here: find /I /N "dir" *.ps1 In...
Downloading Internet Files with Dialog
There is a great way to download large files from the Internet. This example downloads a tutorial video from Idera that, once downloaded will run in...
Using OpenFile Dialog
You can use this code to open a standard OpenFile dialog in your PowerShell scripts:...
Finding Methods with Specific Keywords
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...
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...