Skip to content

Instantly share code, notes, and snippets.

@dfinke
Created May 19, 2015 00:15
Show Gist options
  • Select an option

  • Save dfinke/fe19f796fdfcda90e5d6 to your computer and use it in GitHub Desktop.

Select an option

Save dfinke/fe19f796fdfcda90e5d6 to your computer and use it in GitHub Desktop.
PowerShell WolframAlpha Calendar Cmdlet
function cal {
param(
[string[]]$TargetMonth=(Get-Date).ToString('MMM'),
$Year=(Get-Date).year
)
foreach ($month in $TargetMonth) {
$q = "$month $year calendar"
$appId = "<wolframalpha app id>"
$url = "http://api.wolframalpha.com/v2/query"
$url += "?input=$q&appid=$appId"
"`r`n$month $year"
(Invoke-RestMethod $url).queryresult.pod[1].subpod.plaintext |
ConvertFrom-Csv -Delimiter '|' |
Format-Table -AutoSize
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment