I needed to remove a tag and all the text within a tag. Sounds easy enough. Here is the HTML: $content = ‘Hello <div id=”tag_to_remove”>I […]
Continue readingAuthor: kevin
JavaScript RegExp to Replace Between Text
I wanted to replace all text between two tags. It seems odd, but it resovled an issue I had. Here is the text: Hello<table> <tr> […]
Continue readingInsert a string at a position within another string
I needed to insert a string within another string at a specific position. It is easy to retrieve the position of a string within another […]
Continue readingPowerShell to Search Registry
The following bit of PowerShell code will search the registry for a string. Update $Filter with the string you are searching for and the registry […]
Continue readingHow to install Powershell ISE on Windows 7 or Server 2008 R2
Run the following Powershell command: Import-Module ServerManager; Add-WindowsFeature PowerShell-ISE
Continue readingSet Registry Key Permissions with PowerShell
I found very little information on this object, so I decided to blog about it. The RegistryAccessRule parameters are as follows: RegistryAccessRule (“domain\username”,”Permissions”,”ContainerInherit”,”None”,”Allow”) Where Permissions […]
Continue readingCleaning up my log file in SQL 2008 R2
This morning I noticed that my log file was 450 GB. With only 30 GB remaining on the drive, I had to shrink the file. […]
Continue readingOpen Application as Administrator
Simple Windows 7 trick I learned on learn.iis.net today. To open an application as an administrator from the Start Menu (apart from right clicking and […]
Continue readingQuery Size of Tables in T-SQL
Useful command for SQL 2005 and above to see the size of each table in a given database: USE databasename EXEC sp_MSforeachtable @command1=”EXEC sp_spaceused ‘?'” […]
Continue readingQuery the INFORMATION_SCHEMA for Table Information
A very useful command to query for information about a table from INFORMATION_SCHEMA. Select * From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME=’TableName’
Continue reading