Thanks so much Joe for the feedback - absolutely tried using the casting to unsigned 32 bit integers before posting the question here. Also, in the mean while I have found that by casting them as uint64 variables is a way to get around the errors as listed bellow. Initial testing looks like the returned values are correct when using that type casting however, I'll need to do more analysis before declaring that as a valid work around.
PS C:\temp>
(Get-Command "C:\Program Files (x86)\F5 Networks\iControlSnapIn\iControl.dll").FileVersionInfo
ProductVersion FileVersion FileName
11.4.1.0 11.4.1.0 C:\Program Files (x86)\F5 Networks\iControlSnapIn\iControl.dll
PS C:\temp>
$PSVersionTable.PSVersion
Major Minor Build Revision
3 0 -1 -1
-------------------------------------------------------------------------
function Convert-To-64bit
-------------------------------------------------------------------------
function Convert-To-64bit()
{
param([uint32]$high, [uint32]$low);
[uint64]$ResultAs64 = (($high*[Math]::Pow(2,32)) + $low);
return $ResultAs64;
}
----------------------------------------------------------------------------
function Get-ClientSSL-Stats()
----------------------------------------------------------------------------
{
param(
[string]$SSLProfileName,
[string]$FilePrefix,
[string]$FileName
);
$ProfileSSLStats = $(Get-F5.iControl).LocalLBProfileClientSSL.get_statistics((,$SSLProfileName));
$ProfileStats = $ProfileSSLStats.statistics;
$ProfileTime = Convert-TimeStamp $ProfileSSLStats.time_stamp;
foreach($StatEntry in $ProfileStats)
{
$ProfileItemStats = $StatEntry.statistics;
$ProfileName = $StatEntry.profile_name;
foreach($StatItem in $ProfileItemStats)
{
$StatType = $StatItem.type;
[uint32]$StatHigh = $StatItem.value.high;
[uint32]$StatLow = $StatItem.value.low;
$StatValue = Convert-To-64bit $StatHigh $StatLow;
if ( $FileName.Length -eq 0)
{
Write-Host "$F5LTM, $UsePartition, $ProfileName, $StatType, $StatValue, $ProfileTime";
}
else
{
"$F5LTM, $UsePartition, $ProfileName, $StatType, $StatValue, $ProfileTime" | out-file -filepath ($FilePrefix+$FileName) -append -width 500;
}
}
}
}
ERRORS
Line 256: [uint32]$StatLow = $StatItem.value.low;
Cannot convert value "-177651969" to type "System.UInt32". Error: "Value was either too large or too small for a UInt32."
At C:\Scripts\F5_VipDetails.ps1:256 char:12
+ [uint32]$StatLow = $StatItem.value.low;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastIConvertible
Cannot convert value "-754719906" to type "System.UInt32". Error: "Value was either too large or too small for a UInt32."
At C:\Scripts\F5_VipDetails.ps1:256 char:12
+ [uint32]$StatLow = $StatItem.value.low;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastIConvertible
Cannot convert value "-355986981" to type "System.UInt32". Error: "Value was either too large or too small for a UInt32."
At C:\Scripts\F5_VipDetails.ps1:256 char:12
+ [uint32]$StatLow = $StatItem.value.low;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastIConvertible