First of all, it has a missing '}' in the end. After fixing that one, I realised that any valid move gets the message
InvalidOperation: C:\Downloads\powerchess.ps1:33 Line | 33 | $piece = $chessboard[$fromRow][$fromCol] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot index into a null array. Invalid move: you cannot move your opponent's pieces.