Created
August 16, 2011 14:36
-
-
Save jonschoning/1149228 to your computer and use it in GitHub Desktop.
Visit-AllFiles.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 | |
$worksheet_function = $xl.WorksheetFunction | |
$data = 1,2,3,4 | |
$matrix = ((1,2,3),(4,5,6),(7,8,10)) | |
Write-Host -ForegroundColor green Median | |
Write-Host -ForegroundColor red $worksheet_function.Median($data) | |
Write-Host -ForegroundColor green StDev | |
Write-Host -ForegroundColor red $worksheet_function.StDev($data) | |
Write-Host -ForegroundColor green Var | |
Write-Host -ForegroundColor red $worksheet_function.Var($data) | |
Write-Host -ForegroundColor green MInverse | |
Write-Host -ForegroundColor red $worksheet_function.MInverse($matrix) | |
$xl.quit() | |
$xlprocess | kill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment