comment out unused funcs
This commit is contained in:
@@ -835,37 +835,37 @@ Function Test-RegistryProperty {
|
|||||||
Catch { Return $false }
|
Catch { Return $false }
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to format a quantity of bytes into a denomination
|
## Function to format a quantity of bytes into a denomination
|
||||||
Function Format-ByteQuantity {
|
#Function Format-ByteQuantity {
|
||||||
param(
|
# param(
|
||||||
[int64]$TotalBytes,
|
# [int64]$TotalBytes,
|
||||||
[int]$Precision=2,
|
# [int]$Precision=2,
|
||||||
[string]$Units,
|
# [string]$Units,
|
||||||
[switch]$WithUnitLabel
|
# [switch]$WithUnitLabel
|
||||||
)
|
# )
|
||||||
Switch ( $Units.ToUpper() ) {
|
# Switch ( $Units.ToUpper() ) {
|
||||||
"KB" { $UnitLabel = "KB" ; $Divisor = 1KB }
|
# "KB" { $UnitLabel = "KB" ; $Divisor = 1KB }
|
||||||
"MB" { $UnitLabel = "MB" ; $Divisor = 1MB }
|
# "MB" { $UnitLabel = "MB" ; $Divisor = 1MB }
|
||||||
"GB" { $UnitLabel = "GB" ; $Divisor = 1GB }
|
# "GB" { $UnitLabel = "GB" ; $Divisor = 1GB }
|
||||||
"TB" { $UnitLabel = "TB" ; $Divisor = 1TB }
|
# "TB" { $UnitLabel = "TB" ; $Divisor = 1TB }
|
||||||
default { $UnitLabel = "bytes" ; $Divisor = 1 }
|
# default { $UnitLabel = "bytes" ; $Divisor = 1 }
|
||||||
}
|
# }
|
||||||
Switch ( $WithUnitLabel ) {
|
# Switch ( $WithUnitLabel ) {
|
||||||
$true { Return (ZeroPad-Decimal -Amount $([Math]::Round($TotalBytes / $Divisor,$Precision)) -NeededDecimalPlaces $Precision) + "${UnitLabel}" }
|
# $true { Return (ZeroPad-Decimal -Amount $([Math]::Round($TotalBytes / $Divisor,$Precision)) -NeededDecimalPlaces $Precision) + "${UnitLabel}" }
|
||||||
$false { Return (ZeroPad-Decimal -Amount $([Math]::Round($TotalBytes / $Divisor,$Precision)) -NeededDecimalPlaces $Precision) }
|
# $false { Return (ZeroPad-Decimal -Amount $([Math]::Round($TotalBytes / $Divisor,$Precision)) -NeededDecimalPlaces $Precision) }
|
||||||
}
|
# }
|
||||||
}
|
#}
|
||||||
|
#
|
||||||
# Function to pad zeros onto the end of a decimal number
|
## Function to pad zeros onto the end of a decimal number
|
||||||
Function ZeroPad-Decimal {
|
#Function ZeroPad-Decimal {
|
||||||
param(
|
# param(
|
||||||
$Amount,
|
# $Amount,
|
||||||
$NeededDecimalPlaces
|
# $NeededDecimalPlaces
|
||||||
)
|
# )
|
||||||
$splitNumbers = $Amount.ToString().Split('.')
|
# $splitNumbers = $Amount.ToString().Split('.')
|
||||||
$paddedDecimal = $splitNumbers[1].PadRight($NeededDecimalPlaces, '0')
|
# $paddedDecimal = $splitNumbers[1].PadRight($NeededDecimalPlaces, '0')
|
||||||
Return $splitNumbers[0] + '.' + $paddedDecimal
|
# Return $splitNumbers[0] + '.' + $paddedDecimal
|
||||||
}
|
#}
|
||||||
|
|
||||||
# Function to follow a URL and return the absolute URI of the result (whether redirected or not)
|
# Function to follow a URL and return the absolute URI of the result (whether redirected or not)
|
||||||
Function Get-AbsoluteURI {
|
Function Get-AbsoluteURI {
|
||||||
|
|||||||
Reference in New Issue
Block a user