I am a newbee to PS.
I have a simple Ps script. It was created in Notepad and saved as "profile.ps1". The file is exactly as named- profile.ps1. All that is in it is CD\
1 – set-executionpolicy was RemoteSigned. I have confirmed it.
2 – The ps1 file is put "exactly" in the first folder path location I can see in psmodulepath. (i.e. c:\users\myname\documents\WindowsPowerShell\Modules
3 – When I launch the ISE, it is not getting run.
4 – When I launch native ps, it is not getting run.
5 – I am launching both ise and native ps as administrator.
6 – When I am in PS, I can run the script manually and it works perfectly.
7 – I also put the ps1 script in C:\Program Files\WindowsPowerShell\Modules and it did not run it either.
7 – I am using PS 5.1.14393.693 on Windows 10. I am the admin to the laptop.
Can someone give me a hint on what I may be missing?
I found the problem. It was where I had placed the Ps1 file.
I thought that the ps1 file should be in one of the paths from psmodulepath – wrong.
I dug deeper looking at the $profile location; put the ps1 file in that folder referenced in $profile and it ran perfectly.
Thanks for everyone's observations.