Powershell vs CMD Visual Studio Command Prompt makes a difference?

Hey, so I’m on Windows 11 with both VS2019 and VS2022 installed, though I’m using VS2022 when building Aseprite. I’ve noticed a few peculiar things, like the m87 version of the skia library is the only one that actually builds in my environment. The newer ones fail. That said, this seems to be a known issue according to github.

The thing I wanted to comment on is that whether you use Visual Studio’s CMD dev shell or it’s Powershell dev shell makes a difference in whether or not Aseprite successfully compiles. If I use the CMD shell, everything builds successfully. If I use Powershell, however, the build fails. This seems odd since as far as I’m aware, there isn’t anything about the two environments that should make a difference.

The build halts at 1063/1504 with warnings around the Skia library, but no errors when I scroll up. Anyone have any idea why the build might be failing?

Here is the Powershell script I’m using to build Aseprite:

$asepriteDir="D:\Documents\Programming\aseprite"

Import-Module -Name "$PSScriptRoot\use-vstools.psm1"
Use-VSTools

Set-Location D:\Documents\Programming\aseprite
git pull
git submodule update --init --recursive
Remove-Item "$asepriteDir\build" -Recurse -Force
New-Item -Path $asepriteDir -Name "build" -ItemType "directory"
Set-Location "$asepriteDir\build"
Invoke-WebRequest -uri "https://github.com/aseprite/skia/releases/download/m81-b607b32047/Skia-Windows-Release-x64.zip" -OutFile "$asepriteDir\build\Skia-Windows-Release-x64.zip"
7z x -y -oSkia Skia-Windows-Release-x64.zip
cmake -DCMAKE_BUILD_TYPE=Release -DLAF_BACKEND=skia -DSKIA_DIR=skia -DSKIA_LIBRARY_DIR="$asepriteDir\build\skia\out\Release-x64" -G Ninja ..
ninja aseprite

And for the curious, here’s what I’m invoking to launch into the VS shell:

function Use-VSTools {
    param (
        $Version = 17.0
    )
    if (-not(Get-Command devenv -ErrorAction SilentlyContinue)) {
        $installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version $Version -property installationpath
        if ($installPath.GetType().Name -ne "String") {
            $installPath = $installPath[$installPath.Count-1]
        }
        Import-Module (Join-Path $installPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
        Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64'
    }
}