I'm not too familiar with powershell either, I only use it when I have to. You could try running that command
Add-Type -AssemblyName System.Windows.Forms
$X = [System.Windows.Forms.Cursor]::Position.X
$Y = [System.Windows.Forms.Cursor]::Position.Y
Write-Output "X: $X | Y: $Y"
directly in powershell and see if you get the same error. This is when I run powershell through commandline:
If I run the command by windows searching for powershell it seems to return similar error:
but if I run it again after the errors, it seems to return either string without coordinates or coordinates as it should.
-Jarmo