Cardinality of general linear group of finite rings

Is there a formula for computing the cardinality of the general linear group of $(\mathbb{Z}/n\mathbb{Z})^d$ as a $\mathbb{Z}/n\mathbb{Z}$-module, where $n$ can be any natural number greater than or equal to $2$, not only a prime ? Even better, is there also a way to decompose it into products/semiproducts of smaller groups.

I have tried using ideas of the proof for prime numbers, (counting the number of basis), but it seems much less practical, because of consideration on elements that are part of ideals ($(2,2)$ will not be part of any base in $\mathbb{Z}/10\mathbb{Z}$).

Maybe you can do something by decomposing $n$ into primes factors ?

Edit: I think this is a summary of Han's argument. We have $\mathrm{GL}_{n}(A \times B) \simeq \mathrm{GL}_{n}(A) \times \mathrm{GL}_{n}(B)$ for any two rings $A,B$; hence by the Chinese Remainder Theorem we may reduce to the case when $n$ is a prime power. Now let $A$ be a ring and let $I$ be a square-zero ideal of $A$. Then we have a commutative diagram $\require{AMScd}$ \begin{CD} 1 @>>> \mathrm{id}_{n} + \mathrm{Mat}_{n \times n}(I) @>>> \mathrm{GL}_{n}(A) @>{\alpha}>> \mathrm{GL}_{n}(A/I) @>>> 1\\ @. @VVV @VVV @VVV @.\\ 1 @>>> 1+I @>>> A^{\times} @>{\beta}>> (A/I)^{\times} @>>> 1 \end{CD} where both rows are exact and all the vertical arrows are induced by the determinant map. Here the set $1+I = \{1+i \;:\; i \in I\}$ is a subgroup of $A^{\times}$, and "$\mathrm{id}_{n} + \mathrm{Mat}_{n \times n}(I)$" is by definition the set of $n \times n$ matrices of the form $\mathrm{id}_{n} + M$ where $M$ has entries in $I$, which is a subgroup of $\mathrm{GL}_{n}(A)$. The map $\beta$ is surjective since if $a_{1} \in A$ is a unit in $A/I$ then there exists $a_{2} \in A$ such that $a_{1}a_{2} - 1 \in I$; then $(a_{1}a_{2} - 1)^{2} = 0$ so $a_{1}$ is a unit of $A$. The map $\alpha$ is surjective since if a matrix $M \in \mathrm{Mat}_{n \times n}(A)$ is invertible modulo $I$ then it must be invertible (by the preceding argument, if $\det M$ is a unit modulo $I$ then it is a unit). Thus to compute the order of $\mathrm{GL}_{n}(\mathbb{Z}/(p^{n}))$, we can take $A = \mathbb{Z}/(p^{n})$ and $I = (p^{n-1})/(p^{n})$ in the diagram above and proceed by induction on $n$ (the case $n=1$ is well-known).