Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

File Cannot be Loaded The File is Not Digitally Signed You Cannot Run this Script on The Current System

May 22, 2024
in Blog, Powershell
0
ADVERTISEMENT

Table of Contents

The File is Not Digitally Signed You Cannot Run this Script

Sometimes, when attempting to execute a PowerShell script on Windows systems, you may encounter the following error. Even the Execution Policy is configured as RemoteSign.

y7gBkxv73xgwSywb1L7lX3X1UPxmyjNnKQfFRw8q4QU1vCkzb3ZPgFZZNRh7

This occurs because, by default, scripts downloaded from the internet are blocked from execution to protect the system. You can check it by right-clicking on the script and then selecting Properties.

u0MxkobwOnFnIbVuWTJIRAzcpO17I3UYxZyyNDyy9P5K5AwXed1dPf82lENE

As you can see, in the security section the file is blocked because it came from another computer. To make it executable, uncheck the checkbox then click OK.

ze9cT98tjtcJJ60mYpn0lWN8AtjSNG3zzlgeD3qxgwafN9N6HvyDUAksPt5U

Alternatively, from PowerShell you can check if a file is blocked by using the Get-Item cmdlet with the –Stream parameter. If you get an error, it means the file is not blocked.

Get-Item .\Add_Structure.ps1 -Stream "Zone.Identifier"

If the output resembles the one shown below, it indicates that the file is blocked. You will need to unblock it before you can execute it.

PSPath        : Microsoft.PowerShell.Core\FileSystem::D:\Run-in-Sandbox\Add_Structure.ps1:Zone.Identifier
PSParentPath  : Microsoft.PowerShell.Core\FileSystem::D:\Run-in-Sandbox
PSChildName   : Add_Structure.ps1:Zone.Identifier
PSDrive       : D
PSProvider    : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : False
FileName      : D:\Run-in-Sandbox\Add_Structure.ps1
Stream        : Zone.Identifier
Length        : 85

To unblock a file using PowerShell, we need the Unblock-File cmdlet.

Unblock-File .\Add_Structure.ps1

Once the file is unblocked, if you check it using the Get-Item cmdlet, you will get as below. It’s expected.

PS D:\Run-in-Sandbox> Unblock-File .\Add_Structure.ps1
PS D:\Run-in-Sandbox> Get-Item .\Add_Structure.ps1 -Stream "Zone.Identifier"
Get-Item : Could not open the alternate data stream 'Zone.Identifier' of the file 'D:\Run-in-Sandbox\Add_Structure.ps1'.
At line:1 char:1
+ Get-Item .\Add_Structure.ps1 -Stream "Zone.Identifier"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\Run-in-Sandbox\Add_Structure.ps1:String) [Get-Item], FileNotFoundExce
   ption
    + FullyQualifiedErrorId : AlternateDataStreamNotFound,Microsoft.PowerShell.Commands.GetItemCommand

Finally, use PowerShell to verify that it works.

5x3vTLJMoU8x6oxI9ORPF3wQF3be3lQ0mljht1YH7pkGf9YrhSG5VgSte1Og
ADVERTISEMENT

Not a reader? Watch this related video tutorial:

5/5 - (1 vote)
Previous Post

How to Set the Default Location in Azure PowerShell

Next Post

How to Hide or Disable Breaking Change Warning Messages in Azure PowerShell

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory