PowerShell Error:SecurityError: (:) [], PSSecurityException

Bruce Zhang 26 Reputation points
2021-07-12T02:34:09.007+00:00

Hi All,

I am using Windows MDT to deploy OS and run 2 PowerShell script to install a software (with registry update) and enable BitLocker per our customization request.
Environment:
MDT: 6.3.8456.1000
ADK: 10.1.19041.1
Both of these two script are certificate signed by internal CA

113682-image.png

Error in BDD:

About to run: "C:\MININT\Modules\Microsoft.BDD.TaskSequenceModule\Microsoft.BDD.TaskSequencePSHost40.exe" "\XX.XX.XX.XX\MDTShare$\Scripts\Cisco.ps1" "C:\MININT\SMSOSD\OSDLOGS"
File \XX.XX.XX.XX\MDTShare$\Scripts\Cisco.ps1 cannot be loaded because you opted not to run this software now.
SecurityError: (:) [], PSSecurityException

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 45,906 Reputation points
    2021-07-12T18:39:11.2+00:00

    If you uploaded the file to a share, be sure that the file has not been blocked.

    Does the PowerShell execution policy allow you to run scripts from the target machine?