1

I am using a deployment task sequence to call a Powershell script to install multiple certificates, but it is not installing them.

I am using the following in the Power Shell Script:

Import-Certificate -FilePath "%DeploymentRoot%\Scripts\certs\cert1.cer" -CertStoreLocation Cert:LocalMachine\My
Import-Certificate -FilePath "%DeploymentRoot%\Scripts\certs\cert2.cer" -CertStoreLocation Cert:LocalMachine\My
Import-Certificate -FilePath "%DeploymentRoot%\Scripts\certs\cert3.cer" -CertStoreLocation Cert:LocalMachine\My

I tested changing to the full path and installs fine on the server.

I tested the following in the PS script, but doesn't seem to work eventhough if I run the same code while in the last stages of the imaging processs does work.

Set-ExecutionPolicy Unrestricted 
z: 
cd Scripts\certs 
Import-Certificate -FilePath "cert1.cer" -CertStoreLocation Cert:LocalMachine\My

If I type in the previous code manually while imaging it works. If I try to run the PS script file while imaging I get the following error:

ImportCFRegs.ps1 cannot be loaded because running scripts is disabled on
this system.

I searched the logs in folder C:\windows\temp\Deployment\Logs, but I don't see any filename for that Task Sequence. I did set the task to "Continue on Error".

Rick151
  • 11

0 Answers0