We have been using WinPE for a few months now. Last week I needed to add a driver to the winpe.wim file. Now our imaging script is not writing to image safe data but only when using PowerShell which our script is written in. So using PowerShell, here are the commands and results:
zisedit ScriptedImage=True
Unknown parameter (0): 'ScriptedImage=True'

zisedit ComputerName=$WSNAME
Unknown parameter (0): 'ComputerName=PCTECH-5490'

zisedit dnsHostname=$WSNAME
Unknown parameter (0): 'dnsHostname=PCTECH-5490'

Yet when I boot into WinPE maintenance mode, close zenworktodo.exe and in the command window type zisedit dnsHostname=$WSNAME the result is "The ZISD DNS Host Name is set to 'PCTECH-5490'. I can verify the value has been set in image safe data. But if in the command window I type "powershell" and run the same commands, I get the above errors.

Our winpe.wim files contain the following additions:
WinPE-NetFx
WinPE-NetFx_en-us
WinPE-PowerShell
WinPE-PowerShell_en-us
NIC drivers for the Optiplex 5060 and Surface Pro

Am I missing anything? Any idea why zisedit commands are not running in PowerShell?