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...

read more

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...

read more

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...

read more

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...

read more

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...

read more

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...

read more

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...

read more

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...

read more