# Requires PowerShell 7.3+ for native argument passing (quotes and Markdown). $ErrorActionPreference = 'Stop' if ($PSVersionTable.PSVersion -lt [version]'7.3') { throw 'Please use PowerShell 7.3+ or the Python entry.' } $PSNativeCommandArgumentPassing = 'Standard' $env:PYTHONIOENCODING = 'utf-8' if (Get-Command python -CommandType Application -ErrorAction SilentlyContinue) { & python "$PSScriptRoot/dingtalk_notify.py" progress @args } elseif (Get-Command py -CommandType Application -ErrorAction SilentlyContinue) { & py -3 "$PSScriptRoot/dingtalk_notify.py" progress @args } else { throw 'Python 3.9+ is required.' } exit $LASTEXITCODE