Phrase "He was asked what was it like"

General John Galvin, Supreme Allied Commander in Europe and Commander-in-Chief of U.S. European Command, was asked what was it like to be in charge of so many and various forces.

Is the above sentence grammatically correct?

In that format, I could have written “what it was” not “what was it.”

You’re not supposed to invert the subject and verb in a dependent clause. So, no, it’s not correct, and as Barb said, it should be “what it was like”.

There are some nonstandard dialects of English that do invert the subject and verb in that type of clause, however.