So all this started because i was trying to start a tutorial on ionic 2 with angular, and i was getting annoyed because the powershell showed the full path of my current working directory, so i read an article where you can make the path of the powershell short. here is the article:

http://superuser.com/questions/446827/configure-the-windows-powershell-to-display-only-the-current-folder-name-in-the

as you can see, i have a long path to my current workind directory

PS C:\apachefriends\xampp\htdocs\angular2\ionic2\gettingStarted\ionreddit>

according to the article, you just have to create a file called Microsoft.PowerShell_profile.ps1, so i did.

i restarted the powershell and then i got this error:


. : File C:\Users\toshiba\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.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:3
+ . 'C:\Users\toshiba\Documents\WindowsPowerShell\Microsoft.PowerShell_ ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I googled it and it showed this:


FIX: Go to Start Menu and search for "Windows PowerShell ISE". Right click the x86 version and choose "Run as administrator". In the top part, paste Set-ExecutionPolicy RemoteSigned ; run the script. Choose "Yes".Oct 27, 2010

but that didnt work, so i read the documentation on microsoft website:

https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Core/about/about_Execution_Policies

THE SOLUTION!


OPEN powershell as administrator

$ Set-ExecutionPolicy

Unrestricted

Y

DONE