2

I have an post-build command, which is a .ps1 script, it does move some dlls from one location to another, and also applies some other actions.

Firstly, I am aware of this answer: https://stackoverflow.com/a/4038991/929902

Set-ExecutionPolicy RemoteSigned

This command worked great in my old machine, with VS 2015 Community Edition.

Today, I just installed VS 2017 on a fresh Windows 10 box, and I applied previous command under ISE (with admin privileges). Then I re-started VS 2017, build my project, but my post-build action fails, because and I am stuck on this error.

BuildTasks\AfterBuild.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.

Would it be something related to VS 2017? I also started it with admin privileges.

I even tried Unrestricted command, but even this did not worked.

And idea on this?

Community
  • 1
  • 1
Teoman shipahi
  • 47,454
  • 15
  • 134
  • 158
  • 3
    *Set-ExecutionPolicy RemoteSigned* Did you do this for both x32 and x64 PowerShell? – user4003407 Apr 03 '17 at 04:44
  • @PetSerAl I did not thought of it, it works now. For my case, I run script under 64 bit, but after running on 32 bit ISE, it worked. If you prefer, you can turn your comment as answer and I can accept it. Thanks! – Teoman shipahi Apr 03 '17 at 05:17

0 Answers0