Monthly Archive



I was working with an Exchange 2007 system today - using Get-StorageGroupCopyStatus.  One of the things I was interested in was the logs that had been generated, replicated and replayed.  Exchange 2007 uses 1 MB log files and the file names are based on incrementing numbers - hexadecimal numbers (base 16). Unfortunately Get-StorageCopyStatus reports the log numbers in decimal (base 10).

I can't convert numbers in the thousands, or greater, easily between decimal and hexadecimal. So I use a conversion routine that is based on this:

PS> $x=6904
PS> [convert]::ToString($x,16).ToUpper()

Convert the integer to a string and at the same time convert to base 16 (hexadecimal).  At the same time convert to upper case to make it match the log numbers.

This can be used as the basis of the expression in a calculated field used in format-table or a select statement.  That bit I will leave as an exercise for the interested student of PowerShell   🙂


Share this post :


Technorati Tags: PowerShell,Hexadecimal,decimal

Leave a Reply