Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

PowerShell and VisualStudio?

$
0
0

I have tested a script stand-alone both as and not as the Administrator and it works just fine. So I added this script to a build event as part of a VisualStudio project. When it runs there I get the error:

  xxxx\Merge.ps1 cannot be loaded 
  because running scripts is disabled on this system. For more information, see 
  about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
  At line:1 char:1
  + xxxx\Merge.ps1 
  xxx\ ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess

First the first message is wrong:

PS xxxx> Get-ExecutionPolicy
RemoteSigned

I am running this script as PowerShell xxxx\Merge.ps1 in VS. Where 'xxxx' is the folder where the script is located.

Ideas about why I am getting this security error? Ways to overcome it?


Kevin Burton


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>