I just wanted a .ps1 file that will run a simple line of powershell but not close instantly.
Ive tried to do "read-host -prompt " " " but it is displaying before the code is run and then still closes instantly
get-appxpackage -allusers | select name
read-host -prompt "Press enter to exit"
I expect the outcome to be I run the file and then get a chance to read the output within the powershell window before pressing something to exit. But the actual output is prompts to exit before the code is run and then it runs through the output and closes