Skip to content

Instantly share code, notes, and snippets.

@jonschoning
Created August 16, 2011 14:36
Show Gist options
  • Save jonschoning/1149228 to your computer and use it in GitHub Desktop.
Save jonschoning/1149228 to your computer and use it in GitHub Desktop.
Visit-AllFiles.ps1
# 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