Initial commit

This commit is contained in:
dfinke
2015-12-17 18:10:54 -05:00
parent 775421cad3
commit 1b0c4b682d
2 changed files with 35 additions and 0 deletions

23
Examples/New-PSItem.ps1 Normal file
View File

@@ -0,0 +1,23 @@
function New-PSItem {
$totalArgs = $args.Count
if($args[-1] -is [array]) {
$script:PSItemHeader=$args[-1]
$totalArgs-=1
}
$h=[ordered]@{}
for ($idx = 0; $idx -lt $totalArgs; $idx+=1) {
if($PSItemHeader) {
$key = $PSItemHeader[$idx]
} else {
$key = "P$($idx+1)"
}
$h.$key=$args[$idx]
}
[PSCustomObject]$h
}

View File

@@ -0,0 +1,12 @@
. ..\New-PSItem.ps1
rm *.xlsx
$(
New-PSItem =2%/12 60 500000 "=pmt(rate,nper,pv)" (echo rate nper pv pmt)
New-PSItem =3%/12 60 500000 "=pmt(rate,nper,pv)"
New-PSItem =4%/12 60 500000 "=pmt(rate,nper,pv)"
New-PSItem =5%/12 60 500000 "=pmt(rate,nper,pv)"
New-PSItem =6%/12 60 500000 "=pmt(rate,nper,pv)"
New-PSItem =7%/12 60 500000 "=pmt(rate,nper,pv)"
) | Export-Excel functions.xlsx -AutoNameRange -AutoSize -Show