Particle-in-cell (PIC) simulations are used to study the penetration of magnetic field into plasmas in the electron-magnetohydrodynamic (EMHD) regime. These simulations represent the first definitive verification of EMHD with a PIC code. When ions are immobile, the PIC results reproduce many aspects of fluid treatments of the problem. However, the PIC results show a speed of penetration that is between 10% and 50% slower than predicted by one-dimensional fluid treatments. In addition, the PIC simulations show the formation of vortices in the electron flow behind the EMHD shock front. The size of these vortices is on the order of the collisionless electron skin depth and is closely coupled to the effects of electron inertia. An energy analysis shows that one-half the energy entering the plasma is stored as magnetic field energy while the other half is shared between internal plasma energy (thermal motion and electron vortices) and electron kinetic energy loss from the volume to the boundaries. The amount of internal plasma energy saturates after an initial transient phase so that late in time the rate that magnetic energy increases in the plasma is the same as the rate at which kinetic energy flows out through the boundaries. When ions are mobile it is observed that axial magnetic field penetration is followed by localized thinning in the ion density. The density thinning is produced by the large electrostatic fields that exist inside the electron vortices which act to reduce the space-charge imbalance necessary to support the vortices. This mechanism may play a role during the opening process of a plasma opening switch.