This is not true.
An explicit counterexample is given on p. 154 of the paper On power-invariance, by Eloise A. Hamann, Pacific J. Math., Volume 61, Number 1 (1975), 153-159.
The example was given by Andy Magid at the Commutative Algebra Conference in June of 1974, based on Hochster's counterexample for polynomial rings.
More precisely, Hochster's counterexample provides (using hairy ball theorem) a projective non-free module $P$ over the commutative ring $A = \Bbb R[x,y,z]/(x^2+y^2+z^2-1)$ such that $A^3 \cong A \oplus P$ as $A$-modules.
Let $R$ be the complete symmetric algebra of the $A$-modules $P$, i.e. the completion of the symmetric algebra $S_A(P)$ with respect to the ideal generated by $P$.
Let $S := A[[X,Y]]$.
Then, one can show that
$$R[[T]] \cong A[[X,Y,Z]] \cong S[[T]]$$ as rings (not necessarily as topological rings), but
$$R \not \cong A[[X,Y]] = S.$$
However, theorem 4 in Hamann's paper states that if $R$ has finitely many maximal ideals, then
$R[\![x]\!] \cong S[\![x]\!] \implies R \cong S$, for every commutative ring $S$.
Moreover, theorem 1.4 in Joong Ho Kim's 1974 paper Power invariant rings shows that the same property holds if $R$ has a nilpotent Jacobson radical (i.e. the intersection $J$ of all maximal ideals of $R$ satisfies $J^n=0$ for some $n>0$). For instance, this holds if $R$ is artinian (e.g. a field) or semiprimitive (e.g. $\Bbb Z$).