Logo

dev-resources.site

for different kinds of informations.

Overcoming Execution Policy Restrictions in PowerShell: My Journey with the HNG Internship

Published at
6/30/2024
Categories
backend
hng
django
Author
ogunsolu007
Categories
3 categories in total
backend
open
hng
open
django
open
Author
11 person written this
ogunsolu007
open
Overcoming Execution Policy Restrictions in PowerShell: My Journey with the HNG Internship

I decided to embark on django backend development through HNG intership. setting up my virtual environment was the first starting point where i encoutered issues with power shell. and i will like to share how i was able to find solution to the issue. below is the error message encoutered.

PS C:\Users\qwerty\documents\learn-django> .\myvirenv\Scripts\Activate

.\myvirenv\Scripts\Activate : File C:\Users\qwerty\documents\learn-django\myvirenv\Scripts\Activate.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • .\myvirenv\Scripts\Activate
    + ~~~~~~~~~~~

    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess PS C:\Users\qwerty\documents\learn-django>
  • first i try to understand the problem.The error message indicated that running scripts is disabled on my system due to PowerShell's execution policy settings. PowerShell's execution policy is a safety feature that controls the conditions under which PowerShell loads configuration files and runs scripts. By default, it is set to restrict the execution of scripts to prevent the running of potentially harmful scripts.

  • Opened powershell as an administrator to confirm the current status of the execution policy with the following command

Get-ExecutionPolicy

  • It returned RESTRICTED, this confirms that no script was allowed to run

  • To allow the activation script to run, I needed to change the execution policy. There are several options available, but I opted for the RemoteSigned policy, which allows scripts created on the local computer to run but requires that scripts downloaded from the internet be signed by a trusted publisher. below is the command for this

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

after these step i ran my virtual environment setup again , and it was successful.

Technical challenges are an inevitable part of a developerโ€™s journey, Hereโ€™s to a successful journey with the HNG Internship, where I look forward to tackling more challenges, learning new skills, and growing as a backend developer!. HNG provides a platform for growth and excellence. follow this links for more Internship hire

hng Article's
30 articles in total
Favicon
My Path to Mastery: Overcoming Challenges, Celebrating Wins, and Growing as a DevOps Engineer
Favicon
Automating User Creation: A Streamlined Approach
Favicon
My Exciting Journey with HNG STAGE ONE: Automating User Management with Bash Script
Favicon
Overcoming Backend Challenges: My Journey and Aspirations with HNG Internship
Favicon
Exploratory Data Analysis on the Iris Flower Dataset
Favicon
FRONTEND TECHNOLOGY
Favicon
Linux Users and Groups Management using Bash Script
Favicon
A difficult backend problem I had to solve
Favicon
Creating users and groups from a file with bash.
Favicon
A guide into REACT AND SVELTE
Favicon
lit Comparision REact.js vs Vue.js
Favicon
How I approach new problems as backend engineer
Favicon
Automating The Creation Of Users From A Text File Using Bash Scripting
Favicon
How I Solved a Challenging Backend Problem with PHP & MySQL
Favicon
Backend has never been this interesting...
Favicon
My Mobile Development Journey and Architectural Insights
Favicon
Overcoming Execution Policy Restrictions in PowerShell: My Journey with the HNG Internship
Favicon
My journey into Mobile Development.
Favicon
Frontend Face-Off: React vs. Vue.js - An HNG Intern's Perspective
Favicon
My somewhat rocky start to HNG11...
Favicon
Demystifying Frontend Technologies: React vs Vue.js
Favicon
Starting my journey with HNG
Favicon
Using APIs in a Web Application: Integration and Optimization
Favicon
Automating Linux User Creation with a Bash Script
Favicon
Common Software Architecture patterns in Mobile Application Development.
Favicon
Automating User Management with a Bash Script
Favicon
FRONTEND TECHNOLOGIES: REACTJS VS. NEXT.JS
Favicon
Automating User Management with Bash Scripting: A Practical Guide
Favicon
A Frontend Technology Comparison of Svelte vs Alpine.js
Favicon
React vs. Angular: A Comprehensive Comparison

Featured ones: