18 lines
384 B
PowerShell
18 lines
384 B
PowerShell
# Push daily report to WeCom group webhook
|
|
param(
|
|
[string]$ReportPath
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
Set-Location $Root
|
|
|
|
$python = "python"
|
|
$args = @("-m", "daily", "push")
|
|
if ($ReportPath) { $args += $ReportPath }
|
|
|
|
& $python @args
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "daily push failed with exit code $LASTEXITCODE"
|
|
}
|