Exercise 46, cannot activate

I have been trying to do Exercise 46 for a while now, and I have found that some others were also having the same problem, which is that Windows 10 blocks(I am not sure if this is the right way to describe it) downloaded scripts from running in case they are malwares. People have found solutions, but they solved their problem themselves so I don’t know what they did. I kind of know what I need to change, but I am not sure how I should change it. The answer should be somewhere in here:

Can somebody please help me?

This should do the trick:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process

Thanks for letting me know. Based on what I know, “Process” is saved only for the duration of the powershel session. So if I need to activate again or something and it does not work, I just use the same line?

Yes. You could choose another scope to change it permanently, but I wouldn’t do that. Those restrictions are there for a reason.

1 Like

I encountered another problem when executing the following line; ..venvs\lpthw\Scripts\activate

This is after the execution policy was changed, and here is waht the error message reads:
..venvs\lpthw\Scripts\activate : The term ‘..venvs\lpthw\Scripts\activate’ is not recogniz
ed as the name of a cmdlet, function, script file, or operable program. Check the spelling o
f the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • ..venvs\lpthw\Scripts\activate
  •   + CategoryInfo          : ObjectNotFound: (.\.venvs\lpthw\Scripts\activate:String) [],
      + FullyQualifiedErrorId : CommandNotFoundException

Sorry for asking again, but do you know what might be the problem?

The script for Windows/Powershell may be in a slightly different location. Can you show the contents of the scripts folder?

here it is:

Hm. With PowerShell you’ll need to execute the Powershell script. There’s one called activate, but it doesn’t show the extension. It probably starts with .ps…

It worked when I tried again. I am not sure what was the problem when it didn’t work. Thank you so much for helping me.

A free service run by Zed A. Shaw for learncodethehardway.org.