There is a fundamental difference between outputting data using Write-Host and just "leaving info behind":" Function test {Write-Host...
Month: September 2010
Opening Event Log GUI
In a previous tip, you learned how to register event log sources and write your own event log entries. With Show-Eventlog, you can easily open the...
Creating New Event Logs
Logging information to your event log is easy when using Write-Eventlog. You will just need to register your own event source first by using...
Running Commands Elevated
You can launch a separate PS environment and elevate it Iif you are running your script in a restricted environment and want to run a...
Prompting for Secret Passwords via Console
Whenever you need to enter credentials, you can either use Get-Credential or a low- level PS API function like so: $c =...
Take your indexed columns out of functions to really boost SQL Server performance!
In a future article I will show how to quantify and rank your “heaviest” SQL Server queries according to the overall load they place on...
Prompting for Secret Passwords via Console with Powershell
You can use Read-Host to hide user inputs for safe password prompts: $pwd = Read-Host -AsSecureString 'Enter Password'Enter Password: ******...
Prompting for Passwords
If you need to prompt for a secret password and do not want it to be visible while entered, you should use Get-Credential. This cmdlet returns a...
Performance of COALESCE vs. IS NULL
There are a great many articles out there expounding the virtues of using the ANSI standard COALESCE function over the...
MONyog MySQL Monitor 4.0.2 Has Been Released
Changes (as compared to 4.01) include: Bug Fixes: * Fixed a performance regression (introduced in 4.0) in HISTORY/TREND analysis. * Fixed an issue...
Finding Static Methods
You will find that types can contain very useful methods. To get a list, you can pass the type to Get-Member, but do not forget to specify the...
Identifying 64-Bit-Environments
You will find that one great advantage of 64bit-Environments is the address width of 8 bytes instead of 4 bytes. You can use this to identify...
Finding Maximum Values
Numeric types can store numbers in certain ranges. A byte for example stores values in the range 0-255. But do you know just what the range is for...
Monitoring Disk Space Of Nas Devices
I have 3 different NAS devices (Netgear, Lacie, IOmega) that I would like to monitor through uptime to see if their disk space is being used or...
Finding Days in Month
If you need to determine the days in a given month, you can use the static DaysInMonth() function provided by the DateTime type. As you can see, the...
Finding Leap Years
You will find that the DateTime type supports a number of static methods to check dates. For example, you can check whether a year is a leap year...
Getting Short Dates
Objects contain useful methods to access the object data. For example, DateTime objects support methods to display the date and time in various...
Webyog @ Oracle OpenWorld 2010
Hi, If you are coming to this year’s Oracle OpenWorld 2010, the largest gathering of database enthusiasts, please do visit us at booth #3729. We...
Getting Alphabetical Listings
Unfortunately, PowerShells special ".." operator only supports numeric ranges: 1..10 You can use type conversion to get a range of...
Counting Special Characters
Type conversion can help you count special characters in a text. For example, if you'd like to find out the number of tab characters in a text,...
Chaining Type Conversions
In PowerShell, you can do multiple sequential type conversions. For example, you should first convert the string into a character array and then...
Accessing Event Logs via Conversion
You will find that type conversion can do amazing things. For example, the next line accesses a system log by converting the log name to an EventLog...
Finding WMI Instance Path Names
In a previous tip, you learned about how to access WMI instances directly using their individual instance path. Here is how you can find that path...
Accessing WMI Instances Directly
If you know the path to a WMI instance, you can access it directly by converting the WMI path to a WMI object:...