Preheat your oven to 350°F (175°C). Grease and flour a 9x13-inch baking pan or line it with parchment paper for easy removal.
In a large mixing bowl, combine the grated zucchini, granulated sugar, brown sugar, vegetable oil, eggs, and vanilla extract. Mix well until combined.
In another bowl, sift together the flour, baking powder, baking soda, cinnamon, and salt.
Gradually add the dry ingredients to the wet ingredients, stirring until just combined. If using, fold in the chopped walnuts.
Pour the batter into the prepared baking pan, spreading it evenly.
Bake for 35-40 minutes, or until a toothpick inserted into the center comes out clean. Allow the cake to cool in the pan for 10 minutes, then transfer it to a cooling rack to cool completely.
While the cake is cooling, prepare the frosting. In a mixing bowl, beat the softened cream cheese and butter together until smooth and creamy.
Gradually add the powdered sugar and mix well. Stir in the vanilla extract. If the frosting is too thick, add milk, one tablespoon at a time, until you reach your desired consistency.
Once the cake is completely cool, spread the cream cheese frosting evenly on top.
Slice and serve the cake. Enjoy!