Posted By valdezdj on 11/08/2007 12:28 PM
I'm sorry if this is sounds basic but I haven't seen it in any of the Powershell books or blogs(I don't think) and nobody has submitted anything in awyhile so here it goes...
Is there any way to make a Powershell script just run by clicking on it? I know in VB you could create a script and it would be executable by just clicking on it. I know this isn't VB but its been buggin' me for awhile and I thougt I'd ask. Not really a necessity just curiosity.
Thanks for anyone responding.
Super bad idea. The PowerShell team deliberately associated PS1 with Notepad to avoid the exact security issues that become such a pain with VBScript. Don't think of it as VBScript where you double-click the file, it runs, and WSH goes away... think of just always having the shell window open, so it's easy to type a script name to run it.
The furthest I would go would be to add a Run verb to the file extension, so you could right-click the file and select "Run in PowerShell." You can do all that through Explorer.