A polymerized ionic liquid was prepared using 1,3-dibromopropane reacted with 2-methylimidazole, via a two-step synthetic process. Molecular weight analysis via gel permeation chromatography indicated a M n of 32,600g/mol. An anion exchange is performed to replace the bromide anion of poly(1-propyl-2-methylimidazolium bromide) with bis(trifluoromethanesulfonyl)imide (TFSI). Chemical analysis results closely matched expected results. This polymer was then dissolved in acetonitrile with LiTFSI or Mg(ClO4)2 at a ratio of 1 metal cation (Li or Mg) to 3 imidazolium cations. Ionic conductivity measurements indicate ionic conductivity at room temperature of 0.4mS/cm for the Li/polymer mixture and 0.15mS/cm for the Mg/polymer mixture. Electrochemical measurements indicate that this polymer does allow for the reversible intercalation of the Li+ and Mg2+ cations into graphite.