database-tools

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

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

read more

Type Accelerators

PowerShell has a few shortcuts for popular .NET types like [WMI], [ADSI] or [Int]. You should read the FullName property if you'd like to know...

read more

Comparing Versions

When you compare version strings, PowerShell will use alphanumeric algorithms, which may lead to confusing results: '3.4.22.12' -gt...

read more

Converting Object Types

Once you know the name of an object type, you can use that type for conversion. The next line converts a string into a date-time type: [DateTime]...

read more

Validate Set of Inputs

If you need to limit a function parameter to only a set of allowed choices, you should use the next example: function Get-24hEventLogEntries...

read more