PowerShell error "running scripts is disabled on this system"

I'm brand new to SQL Change Automation and am to the point where I'm trying to run some of the PowerShell scripts on my machine. I installed SQL Change Automation PowerShell 4.3.20267.22294 via the Toolbelt installation.

When running Invoke-DatabaseBuild I get an error of:
'Invoke-DatabaseBuild' command was found in the module 'SqlChangeAutomation', but the module could not be loaded. For more information, run 'Import-Modul SqlChangeAutomation'.

So then I run Import-Modul SqlChangeAutomation and get the error of:

SqlChangeAutomation.psm1 cannot be loaded because running scripts is disabled on this system.

My PS execution policy is Restricted. Here is the confusing part:

Assuming the 4.2.20177 notes are correct, then I'm not sure what to do. I haven't found anything on "The Google" that helps. Is this a bug - so I should contact support?
Tagged:

Comments

  • AdamYAdamY Posts: 55 Bronze 3
    I tried to post this as a "Question" but it kept saving in Drafts and when I edited the draft it would only let me submit it as a "Discussion". Sorry.
  • Hey @AdamY ,

    The execution policy will need to be set to at least 'RemoteSigned' in order to import and run our scripts.

    Restricted doesn't allow the execution of any scripts, so it is likely an error in our release notes. I'm really sorry about that!

    I hope this works for you, but feel free to reply to this thread if there's still a problem, and I'll try my best to help resolve it.

    Many thanks,
    Dan
  • AdamYAdamY Posts: 55 Bronze 3
    The execution policy will need to be set to at least 'RemoteSigned' in order to import and run our scripts.
    Restricted doesn't allow the execution of any scripts, so it is likely an error in our release notes. 
    Thanks, @danielpottenger. I bet the release notes were supposed to say "RemoteSigned", not "Restricted". I'll give it a shot and reply if it still is not working.
Sign In or Register to comment.