Move help from Comment-based to md. Relocate functions (sans help)

This commit is contained in:
jhoneill
2019-11-17 15:30:15 +00:00
parent 07b36e5e56
commit 6d97018de6
133 changed files with 41075 additions and 5241 deletions

View File

@@ -0,0 +1,27 @@
function Get-ExcelColumnName {
param(
[Parameter(ValueFromPipeline=$true)]
$columnNumber=1
)
Process {
$dividend = $columnNumber
$columnName = New-Object System.Collections.ArrayList($null)
while($dividend -gt 0) {
$modulo = ($dividend - 1) % 26
if ($columnName.length -eq 0) {
[char](65 + $modulo)
} else {
$columnName.insert(0,[char](65 + $modulo))
}
$dividend = [int](($dividend -$modulo)/26)
}
[PSCustomObject] @{
ColumnNumber = $columnNumber
ColumnName = $columnName -join ''
}
}
}