Run is producing this error but run in console does not

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.
Post Reply
User avatar
chris.hartmann@braunability.com
Posts: 3
Joined: Thu Dec 01, 2016 9:28 am

Run is producing this error but run in console does not

Post by chris.hartmann@braunability.com » Tue Nov 14, 2017 2:18 pm

ERROR: & : File \\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts\User-Profiles\Get-UserProfile.ps1 cannot be loaded. The file
ERROR: \\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts\User-Profiles\Get-UserProfile.ps1 is not digitally signed. You cannot run this script on
ERROR: the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
ERROR: https:/go.microsoft.com/fwlink/?LinkID=135170.
line (1, 2): ERROR: At Line: 1 char: 2
ERROR: + &'\\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts ...
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : SecurityError: (:) [], PSSecurityException
ERROR: + FullyQualifiedErrorId : UnauthorizedAccess

User avatar
mxtrinidad
Site Admin
Posts: 32
Joined: Sun Mar 03, 2013 12:42 pm

Re: Run is producing this error but run in console does not

Post by mxtrinidad » Tue Nov 14, 2017 2:45 pm

Make sure to have set the execution policy on the machine before running the script. If this system is on a domain network, you may need your security team to set the proper Security Policy to allow the script to execute.

As the error message said, you can run the following command to get information about execution policy:

Get-Help about_Execution_Policies -detailed

:)

User avatar
jvierra
Posts: 11497
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Run is producing this error but run in console does not

Post by jvierra » Tue Nov 14, 2017 3:00 pm

This error:

"File \\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts\User-Profiles\Get-UserProfile.ps1 cannot be loaded. The file
ERROR: \\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts\User-Profiles\Get-UserProfile.ps1 is not digitally signed. You cannot run this script "


Is because the system is set to "RemoteSigned" and the share is not trusted. Your domain admins will not wat to change this or to force you to sign all scripts. This should not happen. This can happen if the domain trust with the PC has a problem or if your Intranet Zone is not set correctly. Contact you net Admin and have them look at your system to see why it is not trusting the share. All shared folders in a domain should be trusted by default. Things happen and can cause this.

Post Reply