Removing Leading Zero from IP Addresses

Here is another (and very solid) approach to remove leading zeroes from an IP address using a regular expression: '010.012.000.101' -replace '\b0+\B' It looks for one or more "0" following a word boundary (\b) and not followed by a word...

Get Fully Qualified Domain Name

There are two simple tricks to find out your current fully qualified domain name (FQDN). You can either resort to ping.exe: PS> ping -a localhost Or, you can use .NET Framework and ask DNS: PS> [System.Net.DNS]::GetHostByName('').HostName  

Finding Next Sunday

If you'd like to find out how long it is until next Sunday (or how many days have passed since last Sunday), simply use the property DayOfWeek. It is a number telling you the current day of the week. So it's easy to calculate the difference between the current...

Launching Applications with Alternate Credentials

If you must run an application with a different identity, Start-Process offers the parameter -Credential. This would launch the Notepad editor using the context of user mydomain\myuser: Start-Process -FilePath notepad -Credential mydomain\myuser However, you may run...

Manipulating Scheduled Tasks

If you need to change and adjust settings in a registered scheduled task, there is a COM interface called 'Schedule.Service' that you can use to access all registered scheduled tasks (Vista/Server 2008 or better). The sample code below accesses the scheduled...

Dumping Scheduled Tasks

There is an underestimated option to make schtasks.exe dump scheduled tasks as CSV data. PowerShell can grab the CSV data and turn it into objects, creating reports with all scheduled tasks in just one line: schtasks.exe /query /fo csv | ConvertFrom-Csv | Where-Object...

Create Strongly Typed Hash Table

A hash table can store any data type. If you want more control, you can create a typed dictionary (which behaves pretty much like a hash table): $ht = @{} $htTyped = New-Object 'System.Collections.Generic.Dictionary[string,int]' $ht.ID = 12 $ht.Person =...

Make Your PowerShell Scripts Click-runnable

If you are like me, you hate having to type in the full path to a PowerShell script to run it.Wouldn’t it be nice if you could just execute it? I’m an old Windows scripter guy (DOS, VBScript, etc), and I’m used to being able to just double-click a...

Clone FireMonkey objects

Clone FireMonkey objects

I've got a task of cloning FireMonkey objects. Let it be "chess". An object is created as an aggregate in design-time. Look at the picture in the Structure pane. I have made the composite pawn model and start thinking of make 15 more. If you’re thinking...

Is Using RECONFIGURE WITH OVERRIDE dangerous?

One of my pet peeves is the use of RECONFIGURE WITH OVERRIDE in scripts to change server options. Am I being unreasonable or is this justified? All you need to do is look up the definition of the WITH OVERRIDE option for the RECONFIGURE command in Books Online to see...

Increase SQL Server Performance Using Multiple Files

By default, SQL Server databases are comprised of two files: the primary data file (or .mdf) and the log file (or .ldf). It is, however, possible to configure SQL Server databases to use additional files – which can be an effective means of increasing SQL Server...

Installing Sonar for Delphi

Installing Sonar for Delphi

On 15th of November the HTML5 Builder QA Team was in the VLCTesting where we learned very good experiences and shared knowledge, amongst this was the software Sonar, Right now in HTML5 Builder we are not using that tool but we found interesting to add a continuous...