In the "Running Windows and Linux builds side-by-side" section of Getting started with AppVeyor for Linux it mentions that in PowerShell we have the following:
$isLinux is $true on Linux
$isWindows is $true on Windows
and in general:
AppVeyor also introduces two new environment variables defining platform:
CI_WINDOWS is true if the build is running on Windows-based image; otherwise false.
CI_LINUX is true if the build is running on Linux-based image; otherwise false.
However, there is no mention of corresponding $isMacOS or CI_MACOS variables. Furthermore, it sounds like $isWindows may not work on Windows (see appveyor/ci#3214 (comment)).