Created
August 16, 2011 14:38
-
-
Save jonschoning/1149233 to your computer and use it in GitHub Desktop.
ExcelMathPowerShell.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calling Excel Math Functions From PowerShell | |
$xl = New-Object -ComObject Excel.Application | |
$xlprocess = Get-Process excel | |
$wf = $xl.WorksheetFunction | |
$data = 1,2,3,4 | |
$m = ((1,2,3),(4,5,6),(7,8,10)) | |
Write-Host -ForegroundColor green Median | |
$wf.Median($data) | |
Write-Host -ForegroundColor green StDev | |
$wf.StDev($data) | |
Write-Host -ForegroundColor green Var | |
$wf.Var($data) | |
Write-Host -ForegroundColor green MInverse | |
$wf.MInverse($m) | |
$xl.quit() | |
$xlprocess | kill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment