Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - File Extension

Reply
 
Old 12-07-2006   #1 (permalink)
Lothar


 
 

File Extension

Hello!
Which File Extension is needed to execute a Powershell Script with a
doubleclick?

And which tools do you use, to write a powershell script?
When i write a script with notepad, i get an error while executing:
Error while loading windows powershell-Console File "(Path to script)":
Invalid at the upper Layer of the document
(translated by myself from german :-) )
my script starts with "start sleep 5", and this syntax is OK, i think
Do you know, waht this Error means and how i can get rid of it?

Thanks for your help!

Lothar


My System SpecsSystem Spec
Old 12-07-2006   #2 (permalink)
Thomas Lee


 
 

Re: File Extension

In message <0D8F8D2F-52B8-4C38-8FB0-57B156781FD7@microsoft.com>, Lothar
<Lothar@discussions.microsoft.com> writes
>Hello!
>Which File Extension is needed to execute a Powershell Script with a
>doubleclick?


By default at any rate, you can't do this.

>And which tools do you use, to write a powershell script?


textpad and notepad.

>When i write a script with notepad, i get an error while executing:
>Error while loading windows powershell-Console File "(Path to script)":
>Invalid at the upper Layer of the document
>(translated by myself from german :-) )
>my script starts with "start sleep 5", and this syntax is OK, i think
>Do you know, waht this Error means and how i can get rid of it?


Did you save in unicode?
--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
My System SpecsSystem Spec
Old 12-07-2006   #3 (permalink)
Rob Kenny


 
 

Re: File Extension

Lothar wrote:
>
> And which tools do you use, to write a powershell script?


Vim and PowerShellAnalyzer

Rob Kenny
My System SpecsSystem Spec
Old 12-07-2006   #4 (permalink)
RichS


 
 

Re: File Extension

For writing scripts - notepad or Visual studio depending on what I'm doing.
Theres a new version of Primal script that has excellent PowerShell support
--
Richard Siddaway

Please note that all scripts are supplied "as is" and with no warranty


"Rob Kenny" wrote:

> Lothar wrote:
> >
> > And which tools do you use, to write a powershell script?

>
> Vim and PowerShellAnalyzer
>
> Rob Kenny
>

My System SpecsSystem Spec
Old 12-12-2006   #5 (permalink)
Dudley LeRoux


 
 

Re: File Extension

poweshell recognizes .ps1 files as powershell scripts. associate the file
extension with powershell in windows, and it'll run, also don't forget to
either sign your scripts, or Set-ExexcutionPolicy UnRestricted



"Lothar" <Lothar@discussions.microsoft.com> wrote in message
news:0D8F8D2F-52B8-4C38-8FB0-57B156781FD7@microsoft.com...
> Hello!
> Which File Extension is needed to execute a Powershell Script with a
> doubleclick?
>
> And which tools do you use, to write a powershell script?
> When i write a script with notepad, i get an error while executing:
> Error while loading windows powershell-Console File "(Path to script)":
> Invalid at the upper Layer of the document
> (translated by myself from german :-) )
> my script starts with "start sleep 5", and this syntax is OK, i think
> Do you know, waht this Error means and how i can get rid of it?
>
> Thanks for your help!
>
> Lothar
>



My System SpecsSystem Spec
Old 12-12-2006   #6 (permalink)
Marcel J. Ortiz [MSFT]


 
 

Re: File Extension

> Error while loading windows powershell-Console File "(Path to script)":
> Invalid at the upper Layer of the document


Sounds like the file was saved with the extension ".psc1" rather than
".ps1".
psc1 is a PowerShell Console File.
ps1 is a PowerShell script which is probably what you want.

> Which File Extension is needed to execute a Powershell Script with a
> doubleclick?


PowerShell doesn't enable this by default. It can be done but you'll have
to enable it yourself.


"Lothar" <Lothar@discussions.microsoft.com> wrote in message
news:0D8F8D2F-52B8-4C38-8FB0-57B156781FD7@microsoft.com...
> Hello!
> Which File Extension is needed to execute a Powershell Script with a
> doubleclick?
>
> And which tools do you use, to write a powershell script?
> When i write a script with notepad, i get an error while executing:
> Error while loading windows powershell-Console File "(Path to script)":
> Invalid at the upper Layer of the document
> (translated by myself from german :-) )
> my script starts with "start sleep 5", and this syntax is OK, i think
> Do you know, waht this Error means and how i can get rid of it?
>
> Thanks for your help!
>
> Lothar
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
File Extension Software
file extension Vista General
File extension Vista General
.pps file extension Vista General
How do you change file name extension in File/Dir Explorer? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46