If you want to systematically test whether you currently have Administrator privileges, you can use this function: function Test-Admin { $identity =...
database-tools
Processing Function Parameters As Hash Table
If you want to get more control over function parameters, you can treat them as hash table. So in your function, you can then check whether a...
Customization of monitors & advisors become more easy with the latest MONyog 4.1
The highlights of this release are: * A brand new helper function interface: We have implemented an easy-form based interface for customizing helper...
Determining Function Parameters Supplied by User
To find out which parameters that a user submitted to a self-defined function, you can use $PSCmdlet like this: function Get-Parameters {...
Re-Running Your Profile
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...
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...