I have a simple powershell file that removes some files with a particular name. I can double-click to run the file which briefly shows the powershell window but it doesn't work. It works if I open a non-admin powershell window and dot-source it or run from the ISE. The file is not blocked and I created it on my local computer. If I add "Pause" to the beginning of the file it still crashes without doing anything which tells me this isn't a problem with the script and is more that Powershell has a problem with me running the script.
Asked
Active
Viewed 111 times
0
-
1This is not surprising. By default it is not possible to run a PowerShell script by double-clicking on it. – Bill_Stewart May 18 '17 at 22:18
-
you can do it with a batch .bat file. have a see on http://stackoverflow.com/a/19335763/259025 – ncowboy May 19 '17 at 02:00