Seven months past the date on dry capsules that stayed sealed in a cabinet is not something I would throw out. On most of these bottles that date is a best by for full label potency, not a safety cutoff. Ashwagandha root powder mostly suffers from moisture and heat rather than from time sitting in a dark cupboard.
What I would actually check is the capsule. If the powder has clumped into a brick, smells musty, or the caps have gone soft and sticky, humidity got in and I would toss it. Otherwise I would expect it to work, maybe a little weaker than a fresh bottle.
One thing worth knowing, if it is a standardized root extract, the withanolide content is the part that fades. So give it a couple of weeks before you decide it is doing nothing.